Came across this handy regular expression utility in Python (I am a beginner in Python). e.g. By using the regexp
(?P<id>[a-zA-Z_]\w*)
I can refer to the matched data as
m.group('id')
(Full documentation: look for "symbolic group name" here)
In Ruby, we can access the matched references using $1, $2
or using the MatchData object (m[1], m[2]
etc.). Is there something similar to Python's Symbolic Group Names in Ruby?