Re: RegExp
| From: | Richard Lynch | Date: | Sat, 16 Dec 2006 01:55:05 +0000 |
| Subject: | Re: RegExp | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245875@lists.php.net to get a copy of this message | ||
On Thu, December 14, 2006 11:47 pm, 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)) {
>
> }
>
>
> It works well but I'm having problems with the " (double quote).
> If there is a double quote (") it fails.
Fails in what way?
Are you sure you are remembering to do http://php.net/htmlentities on
the data you send out for the TEXTAREA to pre-populate it?
Does PCRE need " escaped inside the [] bit? I think not, but I
suppose \\" instead of \" couldn't hurt.
You may also want to move the - to the end of [] character set and
lose the \, just to keep it simpler.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?