> I would like to do a pattern match against a string, sometimes this
> will include the full string, and sometimes it will not, if the
> not include the second match I still want to get the first pattern
> Below is my code, and the results I am looking for.
> Thanks in advance,
> preg_match ("/\:\[(\S+)\]\:(\S*)/",$transport,$matches);
Make the part after the closing ] optional.
$matches should be the IP and $matches should be the port, if it
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php