Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A regexp with \K doesn't work in JRuby #4871
jruby-184.108.40.206 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
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.
\K does not match anything when using JRuby.
@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.