> On Nov 05, 2021, at 06:00, Pu Koh <[email protected]> wrote:
> 
> Is there a function to run multiple find and replace patterns instead of 
> doing it one at a time?

Hey There,

Personally I would most often use a Text Filter and a little Perl, although it 
depends upon the context.  (See appended script.  See “Text Filter” in the 
manual if you don't know how to use them.)

NOTE: JJ's example text's tab separators got turned into spaces by the web. (At 
least in Apple Mail.)

Canon files can be a bit confusing, until you've used them a few times – but 
they can be very useful.

As Bruce suggested – a Text Factory 
is also a perfectly viable option.


--
Best Regards,
Chris


#!/usr/bin/env perl -sw

while (<>) {
    s/\bnuts\b/NUTS!/g;
    s/\bgoofy\b/GOOFY!/g;
    print;
}


Sample Text:


nuts are pretty nutty nuts
nutso

goof
goofy is as goofy does.


-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/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 on the web visit 
https://groups.google.com/d/msgid/bbedit/AD44E03D-1EEA-4A26-9C36-45385CA6E972%40gmail.com.

Reply via email to