note 24197 added to function.preg-match
| From: | josh@php.net | Date: | Fri, 09 Aug 2002 03:06:28 +0000 |
| Subject: | note 24197 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34591@lists.php.net to get a copy of this message | ||
Mr Ravis above's expression works great, but he left out one more possible part of a url. The
anchor, like what follows a # sign at the very end. This includes it:
preg_match("/^((.*?):\/\/)?(([^:]*):
([^@]*)@)?([^\/:]*)(:([^\/]*))?
([^\?#]*\/?)?(\?([^?#]*))?(#(.*))?$/", $oURL->url, $aURL);
list(,, $sProtocol,, $sUsername, $sPassword, $sHost,, $iPort, $sPath,, $sQuery,, $sAnchor) = $aURL;
--
http://www.php.net/manual/en/function.preg-match.php
http://master.php.net/manage/user-notes.php?action=edit+24197
http://master.php.net/manage/user-notes.php?action=delete+24197
http://master.php.net/manage/user-notes.php?action=reject+24197