Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that if the last DONE doesn't exist then a match is still seen and I need to exclude the 'echo DONE'. I suppose I could always remove any instance of 'echo DONE' and then try my match...but I was hoping to do it in my regex.use strict; use warnings; my $string = some data, echo DONE Upgrading packages... Cleaning upgr +ade files... Starting services... DONE'; if ($string =~ /(?!echo Done) Done/i) { print "match found\n"; }
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex help needed
by kennethk (Abbot) on Jul 17, 2009 at 16:45 UTC | |
by Anonymous Monk on Jul 17, 2009 at 16:56 UTC | |
|
Re: regex help needed
by jwkrahn (Abbot) on Jul 17, 2009 at 16:40 UTC | |
by Anonymous Monk on Jul 17, 2009 at 16:47 UTC | |
by JavaFan (Canon) on Jul 17, 2009 at 16:51 UTC | |
|
Re: regex help needed
by JavaFan (Canon) on Jul 17, 2009 at 17:07 UTC |