in reply to Regex to detect and remove a linebreak in an URL
Something like this:
use warnings; use strict; use URI::Find; my $data = join '', <DATA>; $data =~ s/(?<=[.:\/?&])\n//g; $data =~ s/\n(?=[.:\/?&])//g; my $finder = URI::Find->new( sub { print "Found: $_[0]\n"; }); $finder->find(\$data); __DATA__ There's a URL http://here.com and a URL http:// there.com. What else? A really long one http://abc .def.com?foo=bar&foo=bar&foo=bar&foo=bar&foo=bar&foo=bar& bar=foo. And this is a regular line break.
|
|---|