Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: get n lines before or after a pattern

by Kenosis (Priest)
on Jul 25, 2012 at 22:31 UTC ( [id://983746]=note: print w/replies, xml ) Need Help??


in reply to Re^4: get n lines before or after a pattern
in thread get n lines before or after a pattern

I do understand your point. However, the OP appears to be only interested in an exact first name match, given the data set and specific example output. Additionally, the OP says, "...I want to search for a particular first name..." (emphasis mine); sub-string matching does not return a particular first name. Based on these factors, it made sense to force an exact first name match--as the OP's desired output showed. It's certainly easy enough, however, to remove the regex's \bs if my exact-match assumption is incorrect.

Thanks for addressing this issue...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-24 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found