Here is a very blunt regex that should match the opening tag (does not check for the lack of target="_blank":
<a.*?href=".*?\.pdf".*?> Here's a great site: http://gskinner.com/RegExr/ On 18 May 2011 02:30, Lists <li...@commadelimited.com> wrote: > > You could actually do this with jquery quite easily should you want to do it > client side. > > $('a[href*=pdf]').click(function(){ > window.open($(this).href); > }) > > > On May 17, 2011, at 5:35 PM, Duane Boudreau <du...@sandybay.com> wrote: > >> >> Hi All, >> >> First time posting in a very long time. >> >> I'm stuck on a RegEx problem that I can't wrap my head around. I need to >> have a block of html and I need to add target="_blank" to any hyperlink that >> has a pdf link in it. Any suggestions? >> >> Here is the match string I tried so far but I don't think I'm even close. >> >> "<a\\s[^>]*href=['\\\"]( (?i:)(?:jpg|gif|doc|pdf)$*)" >> >> If anyone can point me in the right direction it would be much appreciated. >> >> TIA, >> Duane >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:344611 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm