in reply to Re: Regex and question of design
in thread Regex and question of design
grinder++, What a great module.
When you use tracking to see which regex matched does it still compile to one regex internaly ? The docs say:
Note that when this functionality is enabled, no reduction is performed and no character classes are generated. In other words, brag|tag is not reduced down to (?:br|t)ag<code> and dig|dim is not reduced to <code>di[gm].$re->track( 1 ); if( $target =~ /$re/ ) { print "$target matched by ", $re->matched, "\n"; }
so I infer it it not as optimised as a non tracking version but still better than the looping solution ?
If there are two regexen in the list that match does it return the first, last, all or an indeterminate selection of the above ?
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex and question of design
by grinder (Bishop) on Apr 14, 2005 at 12:53 UTC |