hifirock has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
i want to remove the certain log lines if its starts with -- or remove the words after the --, but if it is present within the double quotes(" test -- done")then no need of substitution.
for Example :
line1: -- test the line,8,description; (Need to remove the line)
line2:test the line,8,description="testing -- done"; (No need)
line3: test the line,8,description="testing -- done"; -- commented line (need to remove the words after the -- symbol)
if i remove with s/(?<!\").*--.*(?<!\")//g its not working,ca n anyone help me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex match only outside the double quotes
by moritz (Cardinal) on Aug 21, 2009 at 07:57 UTC | |
|
Re: regex match only outside the double quotes
by JavaFan (Canon) on Aug 21, 2009 at 08:51 UTC | |
by SuicideJunkie (Vicar) on Aug 21, 2009 at 13:24 UTC | |
by JavaFan (Canon) on Aug 21, 2009 at 13:27 UTC | |
by SuicideJunkie (Vicar) on Aug 21, 2009 at 18:55 UTC | |
by JavaFan (Canon) on Aug 21, 2009 at 22:58 UTC | |
|
Re: regex match only outside the double quotes
by sanku (Beadle) on Aug 21, 2009 at 09:38 UTC |