Need regexp to rejoin URL links broken by \n




Hi regular expression experts.

Can someone help me with a regular expression that removes \n's from
the middle of URL's?

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.

As you can see, the link has been wrapped into the column by a number
of \n's. Obviously, this means the link can't be clicked on.

I'd like to pass this through a regular expression that removes all the
\n's between http:\\ and the next dot followed by a space (that is:
'. ')

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.

Any ideas?

Thank you!

(And are there any tools to help construct and test regular
expressions?)

.



Relevant Pages

  • Re: IO function in Vb.Net slower than in Vb6.0
    ... returned does not contain the terminating carriage return or line feed. ... before you can apply the RegEx anyway. ... >> Can you please paste the regular expression for this? ... if it is changed to reading one ...
    (microsoft.public.dotnet.languages.vb)
  • Re: IO function in Vb.Net slower than in Vb6.0
    ... if it is changed to reading one ... This is the Regular Expression: ... Search For RegEx or ... I'll try to "simulate"(wink wink:) a 400mb file and check performance. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: need help for regular expression
    ... If there's a chance that there will be nested parentheses, ... It seems like you're often asking regular expression questions. ... highly recommend picking up Mastering Regular Expressions by Jeffrey ... After reading just the first two chapters, ...
    (comp.lang.ruby)
  • Re: Find files matching multiple patterns.
    ... You'd do well to do some more reading of ‘grep’. ... A regular expression can have alternation in it: ... when GNU grep can do it for you: ...
    (comp.unix.shell)
  • Re: IO function in Vb.Net slower than in Vb6.0
    ... Can you please paste the regular expression for this? ... Also, on the headofhouse, it could be alphanumeric. ... if it is changed to reading one line ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)