I use Grep in BBEdit a lot for cleaning up websites, but now there's a 
situation where I'm missing something.

I'm redoing a site from WordPress to static, so there are a bunch of links 
that look like:

<a href="/posts/post-name/index.html">Post name</a>

I need to change these so the link looks like:

<a href="/posts/post-name.html">Post name</a>

This seems as though it should be simple to find these instances with:

<a href="/posts/.+?/index\.html">

But if a paragraph contains:

<a href="/posts/post-name/index.html">Post name</a>. <a 
href="/search/index.html">Search here.</a>

It glumps both links (and anything / everything in between) into one found 
result.

I sorta got it to work with this:

<a href="/posts/[a-z].+?[a-z]/index\.html">

But there has to be a more straightforward way. What am I missing?

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/bbedit/d23e7603-0ce1-4fb2-a222-0b7f52b3f24fn%40googlegroups.com.

Reply via email to