lib/regexp-examples/backreferences.rb in regexp-examples-0.0.2 vs lib/regexp-examples/backreferences.rb in regexp-examples-0.1.0
- old
+ new
@@ -21,11 +21,11 @@
full_examples.map! do |full_example|
if full_example.is_a? String
[full_example]
else
full_example.map! do |partial_example|
- partial_example.gsub(/__(\d+)__/) do |match|
- find_backref_for(full_example, $1.to_i)
+ partial_example.gsub(/__(\w+)__/) do |match|
+ find_backref_for(full_example, $1)
end
end
end
end
full_examples