I want to parse user input using named captures for readability.
When they type a command I want to capture some params and pass them. I\'m using RegExps in a case s
named captures set local variables when this syntax.
regex-literal =~ string
Dosen't set in other syntax. # See rdoc(re.c)
regex-variable =~ string
string =~ regex
regex.match(string)
case string
when regex
else
end
I like named captures too, but I don't like this behavior. Now, we have to use $~ in case syntax.
case string
when /(?.)/
$~[:name]
else
end