Named backreferences in regexes seem to be not recognized by RubyMine's code inspection

Try this in RM:

/01\.(?<year>20\d\d) \- 31\.\k<year>/

and it will be highlighted by inspection as illegal escape syntax. Why?

This is perfectly correct regexp expression in Ruby. Here's the proof: 'Named groups can be backreferenced with \k<name>, where name is the group name.' (see Ruby docs for Regexp class, 'Capturing' section)

1 comment
Comment actions Permalink


I think this is a known problem

Regards, Oleg.


Please sign in to leave a comment.