in reply to URLs in plain text
Alternatively, you may want to use the Regexp::Common module:(?:(?:http)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9]) +[.])*(?:[a -zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0- +9]+[.][0-9 ]+)))(?::(?:(?:[0-9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@& +=+$,]+|(?: %[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?: +%[a-fA-F0- 9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a- +fA-F0-9][a -fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+$,]+|(?:%[a-fA-F0-9][a +-fA-F0-9]) )*))*))*))(?:[?](?:(?:(?:[;/?:@&=+$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0 +-9][a-fA-F 0-9]))*)))?))?)
use Regexp::Common; print $&, "\n" while $txt =~ /$RE{URI}/g;
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: URLs in plain text
by Purdy (Hermit) on Nov 11, 2003 at 16:34 UTC | |
by Abigail-II (Bishop) on Nov 11, 2003 at 16:56 UTC | |
by Purdy (Hermit) on Nov 11, 2003 at 17:14 UTC |