Re: ereg
| From: | Jason k Larson | Date: | Thu, 17 Apr 2003 03:31:58 +0000 |
| Subject: | Re: ereg | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144224@lists.php.net to get a copy of this message | ||
What about simply:
$name = "O'Tool";
ereg ('^[[:alpha:][:space:]\']*$', $name, $regs);
print_r ($regs);
--
der Ritter
aka: Jason k Larson
C.R. wrote:
I'm trying to validate a persons name using ereg("^[a-zA-Z[:space:]\\']*$", $name]). This would allow all alpha characters, spaces, and an apostophe. The problem I am having is that the output of $name shows something like O\'Tool, instead of O'Tool. How do I get rid of the slash. Stripslashes does not work, but I don't think using this is appropriate in this situation anyway. Thanks