Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regex problem with .+ matching newlines without /s

by sleepingsquirrel (Chaplain)
on Aug 31, 2004 at 19:45 UTC ( [id://387309]=note: print w/replies, xml ) Need Help??


in reply to Regex problem with .+ matching newlines without /s

Just for fun...
$_ = <<END; recordID: blah fieldname: value foo : bar : baz END for (split /\n\s*/) { ($left, $right) = split /\s*:\s*/; #do stuff... printf "%10s:\t\'%s\'\n", $left, $right; }


-- All code is 100% tested and functional unless otherwise noted.

Replies are listed 'Best First'.
Re^2: Regex problem with .+ matching newlines without /s
by Aristotle (Chancellor) on Aug 31, 2004 at 21:40 UTC

    Don't forget to add a limit to split in case there are more colons than one in some line.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

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

    No recent polls found