From: Hartmut Holzgraefe Date: Sat, 26 Apr 2003 15:34:10 +0000 (+0000) Subject: better 'name' regex X-Git-Tag: SPL_ALPHA~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac2287200691784e76c6f7e04dc29dc1e778cb65;p=php better 'name' regex --- diff --git a/scripts/ext_skel_ng/php_element.php b/scripts/ext_skel_ng/php_element.php index bbbdc8bb5e..4e17d297f7 100644 --- a/scripts/ext_skel_ng/php_element.php +++ b/scripts/ext_skel_ng/php_element.php @@ -1,6 +1,7 @@ "void", "bool" => "bool", @@ -18,7 +19,7 @@ class php_element { "callback" => "callback", ); - if(isset($types[$name])) { + if (isset($types[$name])) { return $types[$name]; } else { return false; @@ -26,7 +27,7 @@ class php_element { } function is_name($name) { - if(ereg("[a-zA-Z0-9_]",$name)) { + if (ereg("^[[:alpha:]_][[:alnum:]_]*$",$name)) { // TODO reserved words return true; } @@ -49,7 +50,7 @@ class php_element { function docbook_editor_footer($level=3) { return '