Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regular Expression Question

by SilverB1rd (Scribe)
on Mar 27, 2001 at 21:39 UTC ( [id://67555]=note: print w/replies, xml ) Need Help??


in reply to Regular Expression Question

Please tell us exactly what you want to do? If your trying to pull the information out of that output try using a regex.

Something like this,
m/(\/.+) +(\d) +(\d) +(\d+) +(\d)% +(.+)/

You would then be able to test $5 to see if it is over 80.

NOTE My regex is not in anyway the best and I'm not even sure if that would work. But I hope you get the idea. If you want to know more read up on regex. UPDATE My post was outdated before I even post it :)

------
The Price of Freedom is Eternal Vigilance

Replies are listed 'Best First'.
Re: Re: Regular Expression Question
by larryk (Friar) on Mar 27, 2001 at 22:00 UTC
    you are right to suspect that this would not work - the single \d as opposed to \d+ before the % would mean that the regex would fail to match unless the % was between 0 and 9.

    what I expect you are looking for is for(<>) { /(\d+)%/; print if $1 >= 88 }

      Thanks larry. Typo on my part. It was supposed to be (\d+)%

      ------
      The Price of Freedom is Eternal Vigilance

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2025-07-19 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.