Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

Regex: Inserting a quote character into link with grepWin tool

Hello Experts,

I have links I need to update that exist in the html pages as  

<a href="www.site.com/xxxxx>

Open in new window

the xxxxx is different in every link but is always some letters or numbers. I was able to piece together a Regex search string to find the string which contains the portion I need:


Open in new window

This will match a result that looks like:


Open in new window

Perfect. But, I am lost on what to use in my Regex replace string to insert the quote symbol just before the wicket. Thanks in advance for your assistance.
  • 2
1 Solution
short of digging into it because my brain is far from that mode right now, this is the tool i use for building and evaluating regex strings


easy to use and pretty slick
JF0Author Commented:
I was looking at that earlier, but it didn't help me find the correct answer. After some further research I think I need to use something called backreferences. I am so lost.

I basically want to match everything before the wicket, and replace it with everything before the wicket + a quote character.
Match String: www.site.com/(.*?)>  (matches everything after the backslash to the ending wicket)

Replace string:  www.site.com/$1">

Depending on the regex engine you are using, you may need to use \1 instead of $1
JF0Author Commented:
Perfect, thanks!

I couldn't think of how to set the sub dir as the reference - seems so simple now.

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now