there are lot of ways to do this.. personally I don't like to use the
Dot. as it matches everything.. and will get you into trouble.. if you
have something like the following..
tempstring = "something 'add==insert' whatever 'edit==update'"
the dot will match you.. 'add==insert' whatever 'edit==update'
below will match 'add==insert' and 'edit==update' separately.
<cfscript>
re = "('[A-Za-z0-9\s]*)==([A-Za-z0-9\s]*')";
REReplace(tempString, re, "\1=\2", ALL);
</cfscript>
more info on regex..
http://www.regular-expressions.info/
Brook Davies wrote:
> Yikes. So is there a better way to do this? I am a bit lost with regular
> expressions...
>
> Brook
>
> At 11:23 AM 3/18/2005, you wrote:
>
>>First, I think you want ([^']*?) instead of (.*)?. You want to
>>non-greedily match everything but single quotes, right?
>>
>>Also, keep in mind that this will do two things you're probably not
>>anticipating. First, it will only replace one set of double-equals per
>>set of single quotes. Secondly, it's not really reading nested quotes, so
>>'this is in quotes' this == is not 'this is again'
>>will come back with the not-in-quotes double-equals replaced.
>>
>>HTH
>>
--
Umer Farooq
Octadyne Systems
+1 (519) 489-1119 voice
+1 (519) 635-2795 mobile
+1 (530) 326-3586 fax
WEB SOLUTIONS FOR NON-PROFIT ORGANIZATION:
http://www.Non-ProfitSites.biz
WARNING: ------------------------------- The information contained in
this document and attachments is confidential and intended only for the
person(s) named above. If you are not the intended recipient you are
hereby notified that any disclosure, copying, distribution, or any other
use of the information is strictly prohibited. If you have received
this document by mistake, please notify the sender immediately and
destroy this document and attachments without making any copy of any kind.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199402
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54