interegular
interegular copied to clipboard
[Bug] found a bug with handling choices
fsm = interegular.parse_pattern("(not(?=\s)|not(?=\()|-)").to_fsm()
assert fsm .accepts('-') == True
assert fsm .accepts('--') == False
Both of the above fail. I expect the first to succeed and the second to fail, because the final state for the second should end at the first '-'.
In contrast:
re.match('(not(?=\s)|not(?=\()|-)', '-')
re.match('(not(?=\s)|not(?=\()|-)', '--')
both of the above succeed (but the span for the second one is still (0, 1)