This code:
string1 = "I will drill for a well in walla walla washington."
/(w.ll) /.match(string1)
is returning only will.
Shouldn't it be returning will and well also?
Check: http://rubular.com/r/48K8o5mzUX
How do I get multiple groups for a regex in Ruby?
It's working fine and it's the expected behaviour. Probably you want to use scan, like in the following:
1.9.2 (main):0 > string1.scan(/(w.ll)/)
=> [["will"], ["well"], ["wall"], ["wall"]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With