Re: Need regexp to rejoin URL links broken by \n



Tony <hawkmoon1972@xxxxxxxxxxx> wrote:

> I have an email inside a variable $A like so:
>
> Hello, this is an
> email which has
> been formatted to
> fit a narrow
> column. Here is a
> URL: http://test.
> com/hello?test=op
> tion1&test2=optio
> n2. Thanks for
> reading.

> removes all the
> \n's between http:\\ and the next dot followed by a space

> Hello, this is an
> email which has
> been formatted to
> fit a narrow
> column. Here is a
> URL: http://test.com/hello?test=option1&test2=option2.
> Thanks for
> reading.


$A =~ s{(http://.*?)\. }
{my $s=$1; $s=~tr/\n//d; "$s.\n"}egsi;


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.



Relevant Pages