Re: class regex
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Mon, 29 Aug 2005 03:35:54 -0700
Brent Clark wrote:
> Hi list
Hello,
> I have im trying to enhance my regex skill.
>
> My questions is, would
>
> m/^p11[016]/io
>
> match like
>
> m/^(p110|p111|p116)/io
>
> Any tips or advice, would greatfully be appreciated.
It appears that they would both match the same string although I would think
that the second example would be slower and less efficient as using
alternation as well as capturing parentheses is usually slower. If in doubt,
use the Benchmark module to test your assumptions.
John
--
use Perl;
program
fulfillment
.
- References:
- class regex
- From: Brent Clark
- class regex
- Prev by Date: Re: open and edit file to prevent race conditions
- Next by Date: Re: Find first day of every week in a month
- Previous by thread: RE: class regex
- Next by thread: open and edit file to prevent race conditions
- Index(es):