Well Monks, by a remarkable coincidence my question is closely related to another posted here today. I'm not a Perl programmer or any other kind of programmer, but I can usually figure out the simple things. However, this one has me stumped.
I have a short Perl script that filters incoming email in preparation for archiving. Some email clients wrap email when sending it -- either by default or because they have been set up that way. So recipients sometimes get broken URLs and there is nothing they can do it about it.
What I need to do is match a broken URL that looks like this:
http://www012.upp.so-net.ne.jp/sculpture/gallery/backnumber/g_s_maeda/ g_maeda_sakuhin2.html
The linebreak may appear anywhere, but the URL is always split on a boundary such as a slash or dot.
Does anyone here have any idea how to construct a regular expression to match an URL broken in this way, with an linebreak at an arbitrary position?
I guess it would be something like this:
The difficult bit (for me) is detecting an URL fragment.
I'm grateful already, as I have found a load of other useful stuff on this miraculous website.
In reply to Regex to detect and remove a linebreak in an URL by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |