Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Help with my regex

by Laurent_R (Vicar)
on Jul 31, 2013 at 21:51 UTC ( #1047319=note: print w/ replies, xml ) Need Help??


in reply to Help with my regex

You could also exclude lines that you don't want:

my $match = 'status|power'; foreach (@data) { next if /NCQ/ or /Supported/; print $_ if /$match/i; }

Or even simpler:

foreach (@data) { print unless /NCQ/ or /Supported/ or /^$/; }


Comment on Re: Help with my regex
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047319]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-31 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls