Re: Regular expressions question

2009-11-19 Thread mangled...@yahoo.com
> > > Can anyone tell me how to write a regular expression which matches > > > anything _except_ a litteral string ? > One could also use a zero-with negative look-ahead assertion: > > #!/usr/bin/perl -w > > use strict; > > while( my $line = ){ >   if( $line =~ m/^(?!Nomatch)/ ){ >     print "mat

Regular expressions question

2009-11-18 Thread mangled...@yahoo.com
Hi, Can anyone tell me hoq to write a regular expression which matches anything _except_ a litteral string ? For instance, I want to match any line which does not begin with Nomatch. So in the following : Line1 Line2 Nomatch Line3 Line 4 I would match every line except