in reply to Re: regex to find vowels in anyorder
in thread regex to find vowels in anyorder
I wouldn't do this as an "anded if" but in a loop with an array of vowels. As soon as the script has found the first vowel the script would continue with the next vowel but if the vowel wasn't found it would stop the whole search as it's not interesting whether the other vowels are in the string.
The performance of my solution depends on the distribution of the strings. Statistically I'm too weak to tell you what is faster. The longer your strings are the worse is my solution. If your search contains a lot of strings and there are some with a length less than number of vowels you could skip the whole test as in a less-than-five(six)-letter-string there is evidently no chance for five(six) different vowels.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: regex to find vowels in anyorder
by JavaFan (Canon) on Dec 19, 2011 at 17:58 UTC | |
by ww (Archbishop) on Dec 19, 2011 at 21:06 UTC | |
by JavaFan (Canon) on Dec 20, 2011 at 01:28 UTC | |
by ww (Archbishop) on Dec 20, 2011 at 03:05 UTC | |
by JavaFan (Canon) on Dec 19, 2011 at 23:31 UTC | |
Re^3: regex to find vowels in anyorder
by SuicideJunkie (Vicar) on Dec 20, 2011 at 00:17 UTC |