Closed mcoulont closed 1 year ago
Basically, you as provider of the pattern/type-definition/type-converter are:
Therefore, if you provide:
regex = "(" + regex2 + ")|(" + regex1 + ")"
# OR BETTER: regex = f"({regex2})|({regex1})"
you get the expected result:
<Result () {'beginning': 'AB=2', 'end': ','}>
NOTES:
(...|...)
choice mechanism in regex seems to executed sequentially.re.match(regex, "AB=2,")
OTHERWISE:
OK thanks I've learnt something today.
Sorry to have disturbed.
Hello.
In the following code the string
AB=2,
can be split 3 different ways:If the shortest first term is the choice,
beginning='A'
andend='B=2,'
If the longest first term is the choice,
beginning='AB=2'
andend=','
:returns
Yet we get neither:
What's supposed to happen?
Thanks for your work