If you just want to replace all occurences of ~AA (caps only), anywhere in the
file and you have the entire file contents in a single variable, the following
should work:

<cfset y = REReplace(x, "(~[A-Z]{2})", "\1~", "all")>

If you need to discern this character sequence only when it's the only thing on
a line, you'll need to step through the file line by line and then use an regex
like:

<cfset y = REReplace(x, "^(~[A-Z]{2})\s*$", "\1~", "all")>



----- Original Message ----- 
From: "Larry Juncker" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 11:18 AM
Subject: OT: Regex question


> Sorry for the OT, but I can not get any answers on CF-Regex..
>
> I have the following code in a text file:
>
> ~TX         which is     tildeSTATECODEspace
>
> I want to do a regex in my text editor that will find every occurrence of
> every state
> and change it to:
> ~TX~    or     ~IA~    OR       ~NC~
>
> I thought that this would do it, but it does not like it:
>
> [~[A-Z][:space:]$]   for my find row
>
> I am using text pad if that makes a difference for the answer.
>
> Otherwise I guess I can keep highlighting each state manually.
>
> Thanks in advance

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to