Jeremy Vinding wrote:
Ing. Branislav Gerzo wrote:
Jeremy Vinding [JV], on Friday, June 03, 2005 at 16:34 (-0600) has on
mind:
this will not match Florida, I think you meant:
/(?:Tampa )?Florida|Tampa/
JV> You caught me, but that matches "Tampa Tampa" too
JV> what I really meant was:
JV> /(?:(?:Tampa )?Florida)|Tampa/
sorry, but it won't match "tampa tampa", just try :)
it match left side from | or right side. not both :)
So you save one (?:)
(see that smile at the end:)
$ perl -le'print "yes" if "Tampa Tampa" =~ /(?:Tampa )?Florida|Tampa/'
yes
my bad, it seems to have to do w/ anchors, the second part of the
alternation was matching.
$perl -le'print "yes" if "Tampa Tampa" =~ /^(?:(?:Tampa )?Florida|Tampa)$/'
--jjv
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>