Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: I'm looking for a one-liner filter 'twixt two regexes

by zigdon (Deacon)
on Sep 05, 2002 at 12:03 UTC ( [id://195341]=note: print w/replies, xml ) Need Help??


in reply to I'm looking for a one-liner filter 'twixt two regexes

like everyone else, I'm not 100% sure I understand what you want. But if it's just to print out the lines between a start and a stop regexp, wouldn't this do the trick?
perl -ne 'print if /start/ .. /end/' *.html
Note that this will not allow /start/ and /end/ to be on the same line. If you want that as an option, you need to replace the .. operator with ....

See man perlop.

-- Dan

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-26 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found