note 108746 added to function.preg-match
| From: | jphansen at uga dot edu | Date: | Tue, 22 May 2012 19:41:50 +0000 |
| Subject: | note 108746 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188137@lists.php.net to get a copy of this message | ||
Here's a regex to validate against the schema for common MySQL
identifiers:
<?
$string = "$table_name";
if (preg_match("/[^\d\sa-zA-Z$_]/", $string))
echo "Failed validation";
?>
----
Server IP: 69.147.83.197
Probable Submitter: 128.192.32.117
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/108746
Del: integrated -- https://master.php.net/note/delete/108746/integrated
Del: useless -- https://master.php.net/note/delete/108746/useless
Del: bad code -- https://master.php.net/note/delete/108746/bad+code
Del: spam -- https://master.php.net/note/delete/108746/spam
Del: non-english -- https://master.php.net/note/delete/108746/non-english
Del: in docs -- https://master.php.net/note/delete/108746/in+docs
Del: other reasons-- https://master.php.net/note/delete/108746
Reject -- https://master.php.net/note/reject/108746
Search -- https://master.php.net/manage/user-notes.php