This is the replace statement a regex guru gave me to wrap a variable found in 
a string in a span tag. 

                          # REReplaceNoCase(answer, '(#search_string#)', '<span 
 class="keyword">\1</span>', 'all')#

It works great, but the variable contains html and it's also replacing stuff 
inside of HTML tags. Example: if the string was "pool" I'm getting results like

        <a href="more_on_pools.cfm">  becomes  <href="more_on_<span  
class="keyword">pools</span>.cfm">
                   or 
        <img src="pool_picture.jpg">  becomes  <img src="<span  
class="keyword">pool</span>_picture.jpg"> 

Is there anything I can do to EITHER NOT do the replace when it's part of an 
href or img src, OR UNDO the replace if it's inside an href or img src tag? 
Either would achieve the same results. 

Any help is appreciated.  This is truly beyond my regex skill level.


Thanks,
Robert

Robert Harrison 
Director of Interactive Services

Austin & Williams
Advertising I Branding I Digital I Direct  
125 Kennedy Drive,  Suite 100   I  Hauppauge, NY 11788
T 631.231.6600 X 119   F 631.434.7022   
http://www.austin-williams.com

Blog:      http://www.austin-williams.com/blog
Twitter:  http://www.twitter.com/austin_wi

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351749
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to