Regex Help for URL's
| From: | Robert Samuel White | Date: | Tue, 16 May 2006 19:52:06 +0000 |
| Subject: | Regex Help for URL's | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-236287@lists.php.net to get a copy of this message | ||
Can someone help me modify the following code?
It was designed to search for all instances of [LEVEL#]...[/LEVEL#]
I need a preg_match_all that will search for all of instances of an URL.
It should be sophisticated enough to find something as complicated as this:
http(s)://x.y.z.domain.com/dir/dir/file.name.ext?query=1&query=2#anchor
Any help would be greatly appreciated!
preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $arcContent,
$tmpMatches);
$arcContent = preg_replace('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim',
'###URL###', $arcContent);