From: Moises Trovo Date: 2008-01-17T08:15:47+09:00 Subject: Re: regular expression On Jan 16, 2008 8:03 PM, Wolfgang Nádasi-Donner wrote: > Rick Denatale wrote: > > Something like this? > > irb(main):001:0> "frabelious" =~ /a.*?e.*?i.*?o.*?u/ > > => 2 > > This doesn't work as expected... > > irb(main):001:0> "xaxxixxexxixxuxxoxxuxx".match(/a.*?e.*?i.*?o.*?u/)[0] > => "axxixxexxixxuxxoxxu" > > ..., because it allows all wovels in any order in the word, if there is > one possible grouping with the wanted ordering - The subpattern "a.*?e" > for example allows any number of "a"s, "i"s, "o"s, and "u"s between the > "a" and the "e". > > Wolfgang Nádasi-Donner > -- > > Posted via http://www.ruby-forum.com/. > > try something like: /a+[^a]*e+[^ae]*i+[^aei]*o+[^aeio]*u+/