Hello.
In python regular expression, named and unnamed groups are both defined with '(' and ')'. This leads to a weird behavior. Regexp
"(?P<a>1)=(?P<b>2)"
used with text "1=2" will find named group "a" with value "1" and named group "b" with value "2". But if i want to use "logical or" operator and concatenate multiple rules, the following regexp:
"((?P<a>1)=(?P<b>2))|(?P<c>3)"
used with same text "1=2" will find an unnamed group with value "1=2". I understood that regexp engine treats "(" and ")" that encloses groups "a" and "b" as an unnamed group and reports that it is found. But i don't want an unnamed groups to be reported, i just want to use "|" in order to "glue" multiple regexps together. Without creating any parasitic unnamed groups. Is it a way to do so in python?