From: gsterndale Date: 2008-07-23T14:34:23+09:00 Subject: largest Regex match possible In the example below I'd like to match 'what is' and 'foo bar'. Any ideas? 'what is foo bar' =~ /(.*)\s*(foo bar|bar)/ => 0 $1 => "what is foo " $2 => "bar" Thanks!