note 22537 added to function.preg-replace

From: Date: Fri, 21 Jun 2002 09:45:35 +0000
Subject: note 22537 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-32087@lists.php.net to get a copy of this message
Wrote this to make a RegExp for use in Javascript to check to see if a number is larger than another function MakeMinReg ($Ref) { $tmp = preg_split("//",$Ref); foreach ($tmp as $key => $val) { if ($val != "") { $Refs[] = $val; } } foreach ($Refs as $key => $val) { $RegRef .= "("; for ($x = 0; $x < count($Refs); $x++) { if ($x == $key) { $RegRef .= "[".$Refs[$x]."-9]"; } else { $RegRef .= $Refs[$x]; } } $RegRef .= ")|"; } $RegRef .= "\d{".(count($Refs)+1).",}"; return $RegRef; } -- http://www.php.net/manual/en/function.preg-replace.php http://master.php.net/manage/user-notes.php?action=edit+22537 http://master.php.net/manage/user-notes.php?action=delete+22537 http://master.php.net/manage/user-notes.php?action=reject+22537

« previous php.notes (#32087) next »