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

A regexp with \K doesn't work in JRuby #4871

Closed
thallgren opened this Issue Nov 28, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@thallgren

thallgren commented Nov 28, 2017

Environment

jruby-9.1.7.0 running on Linux 4.13.13-100.fc25.x86_64 #1 SMP Wed Nov 15 17:33:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

The text matched by the part of the regex to the left of the \K is omitted from the overall regex match. Other than that the regex is matched normally from left to right.

$ irb
2.3.1 :001 > 'street'.match( /s\Kt/)
 => #<MatchData "t"> 

Actual Behavior

\K does not match anything when using JRuby.

$ irb
jruby-9.1.7.0 :001 > 'street'.match( /s\Kt/)
 => nil 
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Nov 28, 2017

Member

Huh, I'm not familiar with \K. Another bit we need to get into Joni.

Member

headius commented Nov 28, 2017

Huh, I'm not familiar with \K. Another bit we need to get into Joni.

@headius headius added this to the JRuby 9.2.0.0 milestone Nov 28, 2017

@thallgren

This comment has been minimized.

Show comment
Hide comment
@thallgren

thallgren Nov 28, 2017

@headius, I must admit, I had never encountered \K either. I found this problem (and the one regarding \X) by testing diffs between Java and Ruby on Regular-Expressions.info. Most headings in that TOC links to a page where the compared flavors can be selected at the top. I found it to be quite helpful.

thallgren commented Nov 28, 2017

@headius, I must admit, I had never encountered \K either. I found this problem (and the one regarding \X) by testing diffs between Java and Ruby on Regular-Expressions.info. Most headings in that TOC links to a page where the compared flavors can be selected at the top. I found it to be quite helpful.

@lopex

This comment has been minimized.

Show comment
Hide comment
@lopex
Member

lopex commented Nov 28, 2017

@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.1.15.0 Nov 28, 2017

@headius headius added the core label Nov 28, 2017

@headius headius closed this in f976136 Nov 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment