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

Backward search with .* #69

Closed
k-takata opened this issue Oct 29, 2016 · 3 comments
Closed

Backward search with .* #69

k-takata opened this issue Oct 29, 2016 · 3 comments
Labels

Comments

@k-takata
Copy link
Owner

Onigmo/testpy.py

Lines 1419 to 1422 in 2cb0bec

# These match differently. Is it okay?
x2(".*[a-z]bc", "abcabc", 0, 6, searchtype=SearchType.BACKWARD)
x2(".+[a-z]bc", "abcabc", 0, 6, searchtype=SearchType.BACKWARD)
x2(".{1,3}[a-z]bc", "abcabc", 2, 6, searchtype=SearchType.BACKWARD)

/.*[a-z]bc/ and /.+[a-z]bc/ both match to 0-6 (abcabc),
but /.{1,3}[a-z]bc/ matches to 2-6 (cabc).

Shouldn't be as follows?
/.*[a-z]bc/: 3-6
/.+[a-z]bc/: 2-6
/.{1,3}[a-z]bc/: 2-6

@k-takata k-takata added the spec label Oct 29, 2016
@k-takata
Copy link
Owner Author

I need to check with oniguruma.

@k-takata k-takata added bug and removed spec labels Dec 12, 2016
@k-takata
Copy link
Owner Author

It turns out that this is a bug of Onigmo. Oniguruma doesn't have this bug.

k-takata added a commit that referenced this issue Dec 12, 2016
This bug was caused when I implemented implicit anchor optimization.
Actually the changes for implicit anchor optimization were totally
useless, because Oniguruma already had the optimization. (Oniguruma
has another bug with the optimization, though.)

Revert the following commits:

* 4a2a618
* 3ea0268
* e20e852

Also add some tests.
@k-takata
Copy link
Owner Author

Fixed.

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

No branches or pull requests

1 participant