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

Hi,

I think this is a known problem http://youtrack.jetbrains.com/issue/RUBY-13811

Regards, Oleg.

0

Please sign in to leave a comment.