Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here's the output of the text file:
If a line contains eg. "Domain Admins all" or "Webmins all", I don't want it output to other file.wwwroot\development\images\_notes\homepage_area_68_f4.jpg.mno Every +one R X wwwroot\development\images\_notes\homepage_area_68_f4.jpg.mno Domai +n\Webmins RWXD wwwroot\development\images\_notes\homepage_area_68_f4.jpg.mno Domai +n\Domain Admins all wwwroot\development\images\_notes\homepage_area_68_f4.jpg.mno Domai +n\user o
I'm trying this regexp:
Which doesn't work - the only of the above text which should be output into the new file is the one containing "Webmins RXWD". The " +\t +" is because \s doesn't appear to work for the whitespace.while (<PERMSFILE>) { if ($_ !~ /Everyone +\t +R X/g | /Webmins +\t +all/g | /Domain Admins +\t +all/g | / o /g) { print SHORTPERMS $_; }
Edit by tye, change PRE to CODE around long lines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RegExp query (hopefully simple)
by jasonk (Parson) on Apr 10, 2003 at 02:52 UTC | |
by billie_t (Sexton) on Apr 10, 2003 at 03:06 UTC | |
|
Re: RegExp query (hopefully simple)
by The Mad Hatter (Priest) on Apr 10, 2003 at 02:56 UTC | |
by billie_t (Sexton) on Apr 10, 2003 at 03:10 UTC |