Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Print 4 Lines below matching criteria

by cLive ;-) (Prior)
on Nov 16, 2006 at 05:10 UTC ( [id://584370]=note: print w/replies, xml ) Need Help??


in reply to Print 4 Lines below matching criteria

m/ \nid: # match new line followed by id: [^\n]* # 0 or more characters that are not new lines \n # a newline ([^\n]*\n){4}) # the next 4 lines and store in $1 /sx; # treat as a '(s)ingle line' and (x) ignore whitesp +ace
edit - I was sober too - omg, back to Idiocy for Dummies...

Replies are listed 'Best First'.
Re^2: Print 4 Lines below matching criteria
by ikegami (Patriarch) on Nov 16, 2006 at 05:56 UTC

    Oops, you forgot to negate your character classes! Also, the s option is useless because . wasn't used.

    m/ \n id: # Match new line followed by id: [^\n]* # 0 or more characters that are not new lines \n # A newline ([^\n]*\n){4}) # The next 4 lines and store in $1 /x; # Ignore whitespace

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-18 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found