but since KM globalizes the \s (space), I get CHGO1249987 - Add - Windshield - to - Car. Unlike how it does on the regex101 site as I can turn the global flag off. I think I understand that KM's regexs are global. Is there a flag to stop this or force it to the first instance?
The entirety, of what I'm trying to solve, is to change the first O (in CHGO1249987) to 0 and the first space after, CHGO1249987 , to a "-" (dash).
The final would simply be: CHG01249987 - Add Windshield to Car
Asking for me and a friend with my exact same name.
No problem, but I am going to embarrass you.
I think you know that you should always post BOTH the source string and the resultant string using a forum Code Block, so that all non-printing characters are properly retained.
Here's my suggestion:
SEARCH FOR: (.+?)\h+(.+)
REPLACE WITH: \1 - \2
See: (.+?)\h+(.+)
This is very easy.
SEARCH FOR: (CHG)O
REPLACE WITH: \10
I put "CHGO" in parenthesis to make it a Capture Group, so that I could just reference it in the Replace, rather than retype it, and maybe make a typo.
Glad to see you're learning RegEx. It is very powerful, and once you get over the initial hump, you will find uses for it every day. BBEdit is a great tool to massage text.