It might be possible - but rather than searching for things not in
<a...>...</a> you search for things that are in </a>...<a...>, and then from
start...<a...> and </a>...end. However I'm not sure if that wouldn't end up
getting confusing.

Simpler (if more long winded solution) would be to replace out all the
anchor tags with marked tokens, then replace all your words, then replace
the anchors back in again.


On 12/19/06, Michael Dinowitz <[EMAIL PROTECTED]> wrote:
>
> I'm trying to do a find/replace on a list of words but the match can't be
> part of an anchor. For example, if I'm looking for the text "cfm", It should
> match the end of this string:
>
> <A href="index.cfm">index.cfm</A> is the main cfm file
>
> The match should ignore the cfm in the href and the cfm in the anchor link
> text. I have the following which works to a certain degree, but not
> perfectly:
>
> REReplacenoCase(string, '(\s|^)(#word#\b)', '\1<A HREF="#word#"
> target="_blank">\2</A>')
>
> This is looking for the word where it is either the start of the string or
> has a space character before it and has a word boundary after it. This will
> work in most cases, but there are cases where it will fail.
> Does anyone have any good ideas on how to write a single regex that will
> match a string that is not within an anchor tag or an anchor block?
>
> Thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1004
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21

Reply via email to