/ Published in: Ruby
URL: http://blog.jayfields.com/2006/10/ruby-regular-expression-replace.html
Equivalent of the Perl code: url =~ s/foo/bar/
Expand |
Embed | Plain Text
url = url.gsub /foo/, 'bar'
You need to login to post a comment.
noah on 03/25/08
2 people have marked this snippet as a favorite
URL: http://blog.jayfields.com/2006/10/ruby-regular-expression-replace.html
Equivalent of the Perl code: url =~ s/foo/bar/
url = url.gsub /foo/, 'bar'
You need to login to post a comment.