Skip to content

(a)?(b)? match problem #24

@homokia

Description

@homokia

I think ab should matches (a)?(b)?. But it doesn't. If the regexp is a?b? then it is ok.

========================> [^(a)?(b)?$] [ab]
SETTING BRACKET 1 [a]
SETTING BRACKET 2 [b]
0 0 [^(a)?(b)?$] [ab]
[^(a)?(b)?$] [ab] re_len=10 step=1 i=0 j=0
[(a)?(b)?$] [ab] re_len=10 step=3 i=1 j=0
QUANTIFIER: [(a)]? [ab]
[(a)] [ab] re_len=3 step=3 i=0 j=0
CAPTURING [(a)] [ab] [?(b)?$]
1 0 [a] [ab]
[a] [ab] re_len=1 step=1 i=0 j=0
<- 1
CAPTURED [(a)] [ab]:1
[(b)?$] [b] re_len=10 step=3 i=5 j=1
QUANTIFIER: [(b)]? [b]
[(b)] [b] re_len=3 step=3 i=0 j=0
CAPTURING [(b)] [b] [?$]
1 0 [a] [b] // I think here should be 1 0 [b] [b]
[a] [b] re_len=1 step=1 i=0 j=0
<- -1
CAPTURED [(b)] [b]:-1
[$] [b] re_len=10 step=1 i=9 j=1
<- -1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions