Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^3: regex doubt on excluding

by hdb (Prior)
on Apr 21, 2014 at 08:46 UTC ( #1082997=note: print w/ replies, xml ) Need Help??

in reply to Re^2: regex doubt on excluding
in thread regex doubt on excluding

How about this?

$string =~ s/^\s*?\n$/\n/mg;

UPDATE: the regex is not working properly but this should, the \n and the $ are somewhat duplicate:

$string =~ s/^\s*?\n/\n/mg;

Comment on Re^3: regex doubt on excluding
Select or Download Code
Replies are listed 'Best First'.
Re^4: regex doubt on excluding
by Anonymous Monk on Apr 21, 2014 at 09:43 UTC

    Thank you hdb... it worked...

    its working with $string =~ s/^\s*?\n/\n/mg; too... :-)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-12-01 00:34 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (789 votes), past polls