I wonder how many different doubled words there are in your docs.
If you did a multi-file search - but not replace - with your pattern, BBEdit
would give you a list of the instances. If scanning them shows that there are
actually not many variations, then you might consider handling them with
search/replace one at a time. "the, the" => "the; "but, but" => "but; etc.
That may take less time than composing and testing a more fully-automated
approach. GP's suggestion shows the power of BBEdit, but if you're only
cleaning those files this one time, maybe more than you need.
I say this as a coder who will spend a couple hours working out a script to
handle some task, and when it's ready after testing it will take 10 seconds to
actually run, and I could have done the work by hand in 20 mins :-).
With any approach, best to work on copies of the originals until you're sure
you have it.
Also, your pattern is fairly restrictive - always exactly a comma and then a
single space between the two words. Are your docs that consistent?
HTH,
— Bruce
_bruce__van_allen__santa_cruz_ca_
> On Nov 10, 2025, at 9:57 AM, GWied <[email protected]> wrote:
>
> This search string finds doubled words separated by a comma and a space,
> which satisfies most of the instances of doubled words:
> (\b[A-Za-z]+\b),\s\1
> replace with
> \1
>
--
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/43346F4F-9969-4153-B24E-3151A7DC0BAE%40cruzio.com.