Skip to content

[Bug] found a bug with handling choices #3

@RevanthRameshkumar

Description

@RevanthRameshkumar
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions