Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect regex matching. #19

Open
gemarcano opened this issue Dec 8, 2014 · 1 comment
Open

Incorrect regex matching. #19

gemarcano opened this issue Dec 8, 2014 · 1 comment

Comments

@gemarcano
Copy link

Using regex ^/group/([^/]+)/name/([^/]+)$ and an input string of /group/, SLRE matches the string incorrectly, with slre_match returning 8 when it should have failed with a return value of -1.

@gemarcano
Copy link
Author

Here's the debugging output from running the aforementioned regex against /group/:

========================> [^/group/([^/]+)/name/([^/]+)$] [/group/]
SETTING BRACKET 1 [[^/]+]
SETTING BRACKET 2 [[^/]+]
doh 0 0 [^/group/([^/]+)/name/([^/]+)$] [/group/]
bar [^/group/([^/]+)/name/([^/]+)$] [/group/] re_len=29 step=1 i=0 j=0
bar [/group/([^/]+)/name/([^/]+)$] [/group/] re_len=29 step=1 i=1 j=0
bar [group/([^/]+)/name/([^/]+)$] [group/] re_len=29 step=1 i=2 j=1
bar [roup/([^/]+)/name/([^/]+)$] [roup/] re_len=29 step=1 i=3 j=2
bar [oup/([^/]+)/name/([^/]+)$] [oup/] re_len=29 step=1 i=4 j=3
bar [up/([^/]+)/name/([^/]+)$] [up/] re_len=29 step=1 i=5 j=4
bar [p/([^/]+)/name/([^/]+)$] [p/] re_len=29 step=1 i=6 j=5
bar [/([^/]+)/name/([^/]+)$] [/] re_len=29 step=1 i=7 j=6
bar [([^/]+)/name/([^/]+)$] [] re_len=29 step=7 i=8 j=7
CAPTURING [([^/]+)] [] [/name/([^/]+)$]
doh 1 0 [[^/]+] []
bar [[^/]+] [] re_len=5 step=4 i=0 j=0
QUANTIFIER: [[^/]]+ []
bar [[^/]] [] re_len=4 step=4 i=0 j=0
SET [^/] [] -> 1
STAR/PLUS END: 0 1 0 0 -1
doh <- 1
CAPTURED [([^/]+)] []:1
doh <- 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant