Apostrophe in preg_match?
| From: | Andre Dubuc | Date: | Wed, 28 Aug 2002 05:17:53 +0000 |
| Subject: | Apostrophe in preg_match? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114325@lists.php.net to get a copy of this message | ||
I'm trying to get an apostrophe (and a dash, as well) to be
included in a preg_match expression, but I don't know how to escape the
characters.
<?php
if (preg_match("^[!a-zA-Z-/\\\'/]^", $_POST['ssname'])) die
("<h5>Numbers and special characters not allowed in
'Surname'<br><br>
Click 'Back' on your browser to re-enter
information.</h5>");
?>
Any help will be greatly appreciated.
Tia,
Andre