Re: Preg_match_all problem
| From: | John Nichel | Date: | Mon, 12 Apr 2004 15:53:08 +0000 |
| Subject: | Re: Preg_match_all problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183164@lists.php.net to get a copy of this message | ||
Jeff McKeon wrote:
Can anyone see why I'm getting this error message: "Warning: No ending delimiter '^' found in C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"You need to enclose your regex in /regex/.... if ( preg_match_all ( "/^([00])?.*$/", $called, $found ) ) -- *********************************************************************** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \ / /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com john@KegWorks.com * 14203 - 1321 * ***********************************************************************From this line:if(preg_match_all("^([00])?.*$",$called,$found)) { substring($called,2,9); } I basically have a phone bill that sometimes has the phone number preceeded by "00" and sometimes not. When it has the "00" I want to trim it with the substring command. Thanks, Jeff