Yes, you can do it using a regex construct called a lookahead (in this case a negative lookahead), like so:
&(?!nbsp;)
To only match ampersands that aren't part of any entity (not just ), you can use this:
&(?!#?\w+;)
Steve
http://blog.stevenlevithan.com> Subject: Find ampersands that are not part of an entity.
> From:
HOF@...
> To:
cf-regex@...
> Date: Fri, 2 May 2008 14:14:23 -0700
>
> I need to search a very long string for ampersands (&) that are not part
> of the non-breaking space entity ( ) and replace them with the
> ampersand entity (&).
>
> Using regex can I say select all instances of a character NOT followed
> by specific other characters?
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;kArchive:
http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1140Subscription:
http://www.houseoffusion.com/groups/RegEx/subscribe.cfmUnsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user837.14401.21