Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by zigdon (Deacon)
on Sep 05, 2002 at 12:03 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2022-09-27 15:32 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (120 votes). Check out past polls.