in reply to regfular expression hlep
If so, this will work:
use Modern::Perl; while (<DATA>) { next if /^\s*case :$|^:|^struct/; print; } __DATA__ case : case : case : keep me : ignore this keep this line struct: get rid of me struct: but keep me
By the way, your regex will also ignore lines which have anything between "case" and the colon. That does not seem to conform to your requirement.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regfular expression hlep
by rajans (Initiate) on Jun 13, 2012 at 21:23 UTC | |
by CountZero (Bishop) on Jun 14, 2012 at 06:11 UTC |