in reply to Re: Regex to detect and remove a linebreak in an URL
in thread Regex to detect and remove a linebreak in an URL
yields$_='o.ne<a>tw/o<b>'; @punks = /[^\w\s]/g; print "<@punks>";
The problem with my example was that I left the /g modifier off the pattern match. I've updated it, and tested it:<. < > / < >>
while(<DATA>){ /http:\S*[^\w\s]/g and s/\G\n//; print; } __DATA__ there is an http://whatever.com/address/ crossing/line/boundaries.html right in the middle of this nice string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Regex to detect and remove a linebreak in an URL
by Anonymous Monk on May 20, 2004 at 00:49 UTC | |
by Roy Johnson (Monsignor) on May 20, 2004 at 01:50 UTC |