RE: regex for &



-----Original Message-----
From: Brent Clark [mailto:brentgclarklist@xxxxxxxxx]
Sent: Thursday, October 30, 2008 10:57 AM
To: beginners@xxxxxxxx
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
.



Relevant Pages

  • Re: regex for &
    ... The view & food is good. ... We are at the Victoria & Alfred Hotel. ... I need a perl regex / code to not print out sentence 2. ...
    (perl.beginners)
  • RE: regex for &
    ... 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 ...
    (perl.beginners)
  • regex for &
    ... The view & food is good. ... We are at the Victoria & Alfred Hotel. ... I need a perl regex / code to not print out sentence 2. ...
    (perl.beginners)