Re: RegExp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux