troubleshooting Question

Need Regex to find url's with underscores only

Avatar of sharingsunshine
sharingsunshineFlag for United States of America asked on
Regular ExpressionsWeb Development
3 Comments1 Solution10 ViewsLast Modified:
I have a website that has old links using underscores and the new s/w uses dashes instead.  I have redirects setup but Google won't index the pages that are using redirects.  So I want to find all links that have underscores.  Here is an example of the links:

<p>Herbs or supplements that help to relax the body will make a great difference if physical stress is involved, such as Nutri-Calm<a href="/product/nutri_calm_100_tablets_p_525/"></a>, <a href="/product/magnesium-250-mg/">Magnesium</a>, <a href="/product/lobelia_100_capsules_p_420/">Lobelia</a>, <a href="/product/lavender_fine_aoc_100_pure_essential_oil_p_35/">Lavender Essential Oil</a> or <a href="/product/geranium-15-ml-100-pure-essential-oil/">Stress-J</a>.   <a href="/product/tei-fu-essential-oil-blend-pocket-size/">Tei Fu</a> 

Open in new window

I put this regex together but it is still catching url's with dashes.

Open in new window

Please help me to fine tune the regex to find only those with underscores.
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros