Actually that should be

<cfset temp = REReplaceNoCase(text, "^[^a-z1-9]", "", "ONE")>

That will replace it only if it is the first character.  The last one I sent
will replace the first occurance of a non alpha-numeric anywhere in the
string.

--K

-----Original Message-----
From: Katrina Chapman [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 4:01 PM
To: [EMAIL PROTECTED]
Subject: RE: need help..


The particular regex (regular expression) provided will remove all non
digits in the text field.  If you want to replace anything that's not a
digit or a letter at the begining of the field you need

<cfset temp = REReplaceNoCase(text, "[^a-z1-9]", "", "ONE")>

--K

-----Original Message-----
From: Vani Kolli [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 8:16 PM
To: CF-Talk
Subject: RE: need help..


Hi Russel,
Does this replaces all special characters to null or only the specified ones
??

Thanks
Vani

-----Original Message-----
From: Russel Madere [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 11:04 AM
To: CF-Talk
Subject: RE: need help..


You can use the REREPLACE() function in CF (RE Stands for Regular
Expression).

For example, to remove non-numerics from a string use:

<cfset temp=ReReplace(Text, "[^[:digit:]]", "", "ALL")>

You can use almost any regular expression comands in there.

Russel

============================================================
  Russel Madere, Jr.         Senior Web Developer
  ICQ: 5446158               http://www.TurboSquid.com

Some days you eat the bear; some days the bear eats you.
============================================================


> -----Original Message-----
> From: Vani Kolli [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 12, 2001 09:44
> To: CF-Talk
> Subject: need help..
>
>
> Hi all,
>
> I have a form field and i want to check if there is any special character
> typed in instead of alphabets and numbers.
> Is there any tag in cf to find it.
>
> I remember doing it in Perl, but not sure of cf.
>
> Any help would be appreciated. Thanks
>
> Vani
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to