>>-----Original Message-----
>>From: Brent Clark [mailto:[EMAIL PROTECTED] 
>>Sent: Thursday, October 30, 2008 10:57 AM
>>To: [email protected]
>>Subject: regex for &
>>
>>Hiya
>>
>>I have three sentences.
>>
>>This is a nice hotel.
>>The view & food is good.
>>We are at the Victoria & Alfred Hotel.
>>
>>I need a perl regex / code to not print out sentence 2 (basically
fail).
>>
>>This is what I so far.
>>
>>print $_  if $_ !~ /\&|Victoria \&/ig;
>>
>>Im struggling to get this right.
>>
>>TIA.
>>
>>Regards
>>Brent Clark

This should work....

if ($_  !~  /^We are at the Victoria \& Alfred Hotel./) {

Marco

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to