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

Re: Reg. Expression problem

by Boogman (Scribe)
on Aug 02, 2000 at 20:25 UTC ( [id://25765]=note: print w/replies, xml ) Need Help??


in reply to Reg. Expression problem

If the line numbers are always at the start of the line and you just wanted to pull out certain ones, you could say
while ( <FILE> ) { print if ( /^(1|3|4)/ ); }
If the line is always a number followed by "perlmonks(stuff)" and you just want to grab the stuff, you could say
while ( <FILE> ) { if ( /^(1|3|4) perlmonks\(([^\)])\)/ ) { print "$2\n"; } }
Is that the checking you wanted to do? If not, you need to describe what you want to be doing a bit better. Anyways, hope that helps.

Log In?
Username:
Password:

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

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

    No recent polls found