There's more than one way to do things | |
PerlMonks |
Re: (2) String order in regex match - left to right, or right to left?by Zero_Flop (Pilgrim) |
on Jun 07, 2003 at 02:56 UTC ( [id://263907]=note: print w/replies, xml ) | Need Help?? |
Enlil stated "The difference is that you have to remember that in: my $ua_name = $1 if ($ua=~ m/(opera|netscape|gecko|msie)/i); The whole regex is checked at every position in your string before moving on to the next position." I would also follow this train of thought but this actually does not explain what is happening. If this was happening Netscape would be found first, going left to right. Does it instead go right to left or is the comparison Alex posted different than what he is running, or is it something completely different? Thanks
In Section
Seekers of Perl Wisdom
|
|