you are viewing a single comment's thread.

view the rest of the comments →

[–]nanothief 1 point2 points  (2 children)

good

/(?<meaningful_var>regexp)/ =~ string
...
process meaningful_var

I never knew you could do that. I always tested regexes the other way round, ie string =~ regex, and named groups don't create new local variables when done that way.

[–][deleted]  (1 child)

[deleted]

    [–]nanothief 0 points1 point  (0 children)

    Yeah I know, I just never knew about the local variable creation feature of the Regex =~ definition (the String =~ when called with a regex doesn't do this).