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

Comments

Projects
None yet
1 participant
@k-takata
Owner

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

This comment has been minimized.

Show comment
Hide comment
@k-takata

k-takata Oct 29, 2016

Owner

I need to check with oniguruma.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@k-takata

k-takata Dec 12, 2016

Owner

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

Owner

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

Fix backward search with .* (Issue #69)
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

This comment has been minimized.

Show comment
Hide comment
@k-takata

k-takata Dec 12, 2016

Owner

Fixed.

Owner

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