[Omaha.pm] (?:pattern)

Andy Lester andy at petdance.com
Thu Oct 21 07:37:56 PDT 2010


On Oct 21, 2010, at 9:32 AM, Jay Hannah wrote:

> Since the author isn't using the backreferences anyway, why not just
> 
>   /^INS_(CHC|CRS|PLV)$/
> 
> Isn't that the same thing and easier to read?
> 
> I should probably write some little programs to test it, but I'm feeling lazy.  :)

There's presumably a speed-up because it's not dumping the match into $1.  You'd have to benchmark to find out just how much it's saving.

The bigger change is getting rid of the outer grouping parens which are not even needed for grouping.

xoox,
Andy

--
Andy Lester => andy at petdance.com => www.techworklove.com => AIM:petdance







More information about the Omaha-pm mailing list