I have such a regex:
(<.*?>)
It allows me to find all the substrings starting with < and ending with >.
For instance, like the following:
<IL_A_NUM>
My regex expression helps me to find the strings as above. The expression .*? involves all characters, but I want to exclude strings with < or > inside from my search. So, if < or > appears between another < and > my search won't give me that subpart.
How should I modify my regular expression?
?.re.sub(r'(<)(.*)(>)', r'\1your_last_character_to_replace\3', your_string)relibrary doesn't support recursion/nested groupings... do you have some better examples of exactly what you're trying to achieve as this seems to be a bit of an XY Problem