Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Help with my regex

by cspctec (Sexton)
on Jul 31, 2013 at 21:13 UTC ( #1047315=note: print w/replies, xml ) Need Help??

in reply to Re: Help with my regex
in thread Help with my regex

I'm not sure how to get "Power State" only without also grabbing "Supported Power State" since they both have the same string in them. I just need the shorter one.

Replies are listed 'Best First'.
Re^3: Help with my regex
by Preceptor (Deacon) on Jul 31, 2013 at 21:25 UTC
    m/^Power State:/

    The ^ is an anchor to 'beginning of line'.

Re^3: Help with my regex
by SuicideJunkie (Vicar) on Jul 31, 2013 at 21:36 UTC

    The match in that code above grabs everything up to the first colon. Which means it will get "Supported Power State" on that line, which will then not exist in the hash of things you want. Later it will get "Power State" on the shorter line, and that will exist in the hash of things you want.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047315]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-06-24 11:00 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.