Hi Sander,

On Mon, Dec 01, 2014 at 02:34:26PM +0100, Sander Klein wrote:
> Hi,
> 
> I'm testing some stuff with quite a big regex and now I am wondering 
> what would be more efficient. Is it more efficient to load the regex 
> with -i or is it better to specify it in the regex....
> 
> So,
> 
> -i (some|words)
> 
> or
> 
> ((S|s)(O|o)(M|m)(E|e)|(W|w)(O|o)(R|r)(D|d)(S|s))

The first form is more efficient as it is natively handled by the
regex engine when comparing chars, instead of building a tree of
all possibilities as you have in the second form.

Willy


Reply via email to