Re: RegExp
| From: | Jochem Maas | Date: | Fri, 15 Dec 2006 08:14:30 +0000 |
| Subject: | Re: RegExp | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245852@lists.php.net to get a copy of this message | ||
WeberSites LTD wrote:
> I'm trying to limit the text someone can submit in a text area with :
>
>
> Code:
> if(!preg_match("/^[א-תA-Za-z0-9_():,@\/\.\s\-\" ]*$/i",$FieldValue)) {
^^ ^-- no need for the space given you already have '\s'
^^
^^--- these brackets need escaping
>
avoid sticking your regexps in double quotes strings - you just end up
giving yourself an escaping headache.
what is exactly is the goal of the 'limit' you are imposing - wouldn't something
like strip_tags() be much easier?
> }
>
>
> It works well but I'm having problems with the " (double quote).
> If there is a double quote (") it fails.
>
>