Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
9 lines (8 sloc) 180 Bytes
---
gsub: |-
>> "dog cat".gsub(/(dog) cat/, "cat")
=> "cat"
>> "dog cat".gsub(/(dog) cat/, '\1')
=> "dog"
>> "20 dogs".gsub(/\d+/) { |num| num.to_i + 1 }
=> "21 dogs"