BBEdit's Pattern Playground is a big help in constructing grep find and 
replace patterns. If you could use some help with regular expression 
grammar to use, there's a grep cheat sheet (the circled ? drop down menu) 
on the "Search patten:" line and Chapter 8, "Searching with Grep" in the 
BBEdit User Manual has additional information on grep patterns and syntax.

That said, assuming the name format in your example, a "Find:" (or "Search 
pattern:" for the Pattern Playground) grep pattern of:

(\w+) (\w+) (\w+)\s+(\w+ \w+ \w+)

 and a "Replace:" (or "Replace pattern:" for the Pattern Playground) grep 
pattern of:

\1 \2 \3 / \4 / \L/\1-\2-\3 /

will result in replacement text of:

John Allen Doe / Justine Zen Center / /john-allen-doe /

You may need to tweak the find grep pattern if there's some variation in 
spacing between the first, middle, and last name components. The above grep 
pattern assumes one and only one space between name components and one or 
more white space characters between the two names.

For an explanation of the \L in the replace grep, see the grep cheat sheet 
drop down next to the  Pattern Playground "Replace pattern:".

On Saturday, April 5, 2025 at 5:22:05 PM UTC-7 Kim Mosley wrote:

> To convert:
>
> John Allen Doe    Justine Zen Center 
>
> to 
>
> John Allen Doe / Justine Zen Center / /john-allen-doe / 
>
> Thank you!!!
>

-- 
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/dc6a1235-0fce-45f4-82a9-70b90fd93144n%40googlegroups.com.

Reply via email to