backreferencing with named groups in gsub broken #2126

Closed
andreaseger opened this Issue Jan 15, 2013 · 1 comment

Comments

Projects
None yet
2 participants

backreference with numbers

$> ruby-1.9.3-p362 -e "p 'hello'.gsub(/([aeiou])/, '{\1}')"     
"h{e}ll{o}"
$> rbx-head -X19 -e "p 'hello'.gsub(/([aeiou])/, '{\1}')"
"h{e}ll{o}"

backreference with named group

$> ruby-1.9.3-p362 -e "p 'hello'.gsub(/(?<foo>[aeiou])/, '{\k<foo>}')"
"h{e}ll{o}"
$> rbx-head -X19 -e "p 'hello'.gsub(/(?<foo>[aeiou])/, '{\k<foo>}')"
"h{\\k<foo>}ll{\\k<foo>}"

examples from ruby-docs

Contributor

jamesotron commented Feb 15, 2013

Confirmed the same for me.

dbussink added a commit that referenced this issue Jul 21, 2013

@dbussink dbussink closed this in 91f0a52 Jul 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment