Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: regexp need a match characters and spaces

by reasonablekeith (Deacon)
on Mar 23, 2006 at 11:17 UTC ( [id://538712]=note: print w/replies, xml ) Need Help??


in reply to Re: regexp need a match characters and spaces
in thread regexp need a match characters and spaces

This works for the OP's code, but would force the need for a trailing newline if the OP wanted to match what came after c.

If you swap the regex for the following you'll remove that requirement. Note the I've had to swap out the \s+ as this was scooping up the newline character if there was no data on the line, resulting in the regex matching the whole of the following line.

/^b +([^\n]*)$/m;
---
my name's not Keith, and I'm not reasonable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found