Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-10-23 08:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.