Hi, I am running bluedragon free edition and I am trying to write a regular
expression to remove part of a query string. I grab the query string from
cgi.query_string and store it as a variable "location". The substring I
would like to remove would always be either "&lang=1" "&lang=2" or "&lang=3"
- it could appear without the "&" (as the first element in the query
string). 

So, I tried creating a regular expression to remove it and came up with the
following:

<cfset location = ReplaceNoCase(location,"[:punct:]?lang=[0-9]", "", "ALL")>

It does not work. I decided to work in steps and tried this, without
worrying about the punctation:

<cfset location = ReplaceNoCase(location,"lang=[0-9]", "", "ALL")>

So, I tried this:

<cfset location = ReplaceNoCase(location,"lang=", "", "ALL")>

And it worked, but it isn't doing what I want. So it seems other than
literal strings (like "lang=") I can't get any regular expression to work.
To test, I did the following:

<cfset teststring = "this&that=3">
<cfset teststring = ReplaceNoCase(teststring,"[0-9]", "", "ALL")>

It does nothing. 

Am I doing something wrong? Thanks. 

Doug

 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255879
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to