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
bug

Comments

@k-takata
Copy link
Owner

@k-takata k-takata commented Oct 29, 2016

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

@k-takata k-takata commented Oct 29, 2016

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

@k-takata k-takata commented Dec 12, 2016

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

@k-takata k-takata commented Dec 12, 2016

Fixed.

@k-takata k-takata closed this Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.