The search term

<a href="/posts/[^>]+/index\.html">

only has two regular expressions (grep):

(1) "[^>]+" which translates to "one or more characters that are not >" and

(2) "\." which translates to the period character.  (Because it has a
special meaning in grep, when all we want to do is search for a period, the
"\" is required to "escape" the special meaning.)

On Thu, Dec 19, 2024 at 5:34 AM Greg Raven <[email protected]> wrote:

> This works, thanks! I don't understand the syntax, but it works. Much
> appreciated.
>
> On Wednesday, December 18, 2024 at 2:58:41 PM UTC-8 Rick Gordon wrote:
>
>> What about:
>>
>> <a href="/posts/[^>]+/index\.html">
>>
>> Rick Gordon
>> ------------------------------
>> From: Greg Raven <[email protected]>
>> To: BBEdit Talk <[email protected]>
>> Date: Wed, Dec 18, 2024 10:03:23AM -0700
>> Subject: Grep non-greedy finding is not working for me in this instance
>>
>> 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>
>> -
>>
>> _______________________________________
>> RICK GORDON
>> _______________________________________
>> EMAIL: [email protected]
>> WWW: www.shelterpub.com
>> ------------------------------
>>
> --
> 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/0c965ddc-0a84-46b7-8fb1-d919c267c045n%40googlegroups.com
> <https://groups.google.com/d/msgid/bbedit/0c965ddc-0a84-46b7-8fb1-d919c267c045n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Mark Bowron
1650 S CASINO DR #2202
LAUGHLIN, NV USA 89029-1512
+1 224-357-6070

-- 
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/CACihOAvXPEW4ez_gP%2B7nnxxOc6Zkufg7mF9FVt6udji85WhyoQ%40mail.gmail.com.

Reply via email to