preg_match problem
| From: | Chris N | Date: | Mon, 30 Sep 2002 05:14:16 +0000 |
| Subject: | preg_match problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-118143@lists.php.net to get a copy of this message | ||
Ok heres the situation, I have a string like this
$this->_item["title"] = "28.09.02 - Some silly Text (First) (Second)";
Im trying to do a preg_match on it to check it to make sure its in a certian
format. Heres my preg_match
preg_match("/^(\d+)\.(\d+)\.(\d+)\s+\-\s+(.+)\s+\((.+)\)$",
$this->_item["title"], $matches);
list($all, $one, $two, $three, $four, $five) = $matches;
What Im getting returned in this
$one = 28
$two = 09
$three = 02
$four = Some silly Text
$five = First) (Second
What I want is
$four = Some silly Text (First)
$five = Second
Can anyone see where Im going wrong? The match may be really crude, Im still
pretty new to regular expressions. But it works just fine as long as there
is only one set of ().
Chris N.