[Top] [All Lists]

Re: UTF-8 Regular Expression Whitelist

Subject: Re: UTF-8 Regular Expression Whitelist
From: GArlington
Date: Tue, 14 Aug 2007 02:40:22 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion
On 13 Aug, 19:37, "trapneto" <[email protected]> wrote:
> I'm trying to create a whitelist regular expression for form input.
>  <cfset pattern_name = "^[\w]+[\w-\.,\s'""]*$"> works for Ascii, but I need to
> include characters 192-255 in the ISO 8859-1 character set.
>  <cfset pattern_name = "^[\w?-?]+[\w?-?-\.,\s'""]*$">
>  doesn't work.   ?sterstr?m, Garz?n, and M?rquez are all rejected.
>  Does anyone know how to fix it?

I beleive you have to escape ? mark, i.e. \?

<Prev in Thread] Current Thread [Next in Thread>