Assuming what you're actually asking is how to escape any ampersands that are not part of an existing entity, try this...
REReplace(Text,"&(?!([##A-Za-z0-9]{2,6};))","&","all") (because any non-entity ampersands must be escaped everywhere, not just in links) > Okay, I can usually figure out my regular expressions when needed, but > this one has me a bit stumped. Basically I have an unknown chunk of > text in which I need to make sure any URLs are XHTML-compliant...i.e. > any ampersands are escaped, if not already. I need to be sure to only > replace within the <a> tags, not the rest of the text, and to not > replace any ampersands that are already escaped. Anyone want to take a > stab at it? > > --- Mary Jo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272305 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4