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?
gflag which tells their Regular Expression parser to look through the target string for all matches. Ruby doesn't haveg, so we usescanas @lucapette recommends.String#matchis usually used in boolean context.