Created
July 29, 2012 15:24
-
-
Save anonymous/3199461 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = '1/2' | |
regex = /(?<group1>\d+)\/(?<group1>\d+)/ | |
str.gsub!(regex) do |match| | |
match['group1'] = '3' | |
match['group2'] = '4' | |
match | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IndexError: string not matched | |
from (irb):9:in `[]=' | |
from (irb):9:in `block in irb_binding' | |
from (irb):8:in `gsub!' | |
from (irb):8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment