Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: splitting lspci output

by HuckinFappy (Pilgrim)
on May 18, 2006 at 05:54 UTC ( [id://550165]=note: print w/replies, xml ) Need Help??


in reply to Re^3: splitting lspci output
in thread splitting lspci output

In other words:
m/ ^(\S+) # Grab all non white space at the start into $1 \s+ # Skip any white space ([^:]+) # Now grab everything that isn't a colon in $2 : # End the grab for $2 at the colon \s+ # Skip any white space ( # Going to capture into $3 (?: # Start non-capturing parens (?! # Start negative lookahead \s* # Look for some white space \(rev # Followed by (rev ) # Close negative lookahead .) # Close non-capturing parens +) # So if whitespace followed by (rev, grab it $3 \s* # Up until some white space (.*) # Grab everything else after the white space into +$4 /x;

I really just wanted to demonstrate to the OP how to powerfully use the /x modifier

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-28 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found