Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: FAST way to pull multiple lines around a keyword

by rizzy (Sexton)
on Oct 19, 2010 at 19:10 UTC ( #866156=note: print w/replies, xml ) Need Help??


in reply to Re: FAST way to pull multiple lines around a keyword
in thread FAST way to pull multiple lines around a keyword

Thanks. I think I may do what you suggest.

One thing I did which DID speed things up very much was add a line break (/n) at the beginning and end of the match. That way there is only one possible match (for each keyword). What it was doing before was taking every possible combination of characters from the previous line and the subsequent line (i.e., .+) and then picking the longest one. Including the line break explicitly gives it only one choice.

  • Comment on Re^2: FAST way to pull multiple lines around a keyword

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://866156]
help
Chatterbox?
[Discipulus]: ah i become monsignor the same day of sysadmin day
[marto]: not so great OS :P
Eily never heard of the movie "LanX"
[Eily]: the LanX OS either now that I think of it :P
[hippo]: Congratulations, Discipulus!
[Discipulus]: Satura Lanx was a latin genre of show
[Discipulus]: coming from the meaning of 'mixed dish'
[Discipulus]: thanks hippo! the hat you passed me was brand new and clean, thanks

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-07-28 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (426 votes). Check out past polls.