I would add to this that the original poster probably wanted to add , England
to the end of each place, rather than just England So replace with \12\, England is required. Roger > On May 11, 2022, at 4:10 AM, Dave Simpson <[email protected]> wrote: > > Thanks Bucky > > That helps me a lot. > Dave > > On Monday, May 9, 2022 at 4:14:01 AM UTC+1 buckyjunior wrote: > I was fortunate to learn some bits of regex/grep from helpful people on this > list who not only showed an answer to a question but explained what was > happening. While this search/replace using grep is quite simple, it’s not > always obvious to everyone. > > > > On May 8, 2022, at 1:36 PM, Dave Simpson <[email protected] > > <applewebdata://D2C84AEA-9D78-4BAC-84F9-0438D29C4025>> wrote: > > > > You want to do a GREP search, with search string like this: > > > > ^(2 PLAC)(.*)$ > > > > And you want to replace with this: > > > > \1\2 England > > > > That’s it. Try it. > > > > In the search pattern: > ^ means start at the beginning of a line > (2 PLAC) parentheses bracket the search text and “remembers" it. In this > case, it is known characters. Grep lets you search for unknown/partially > known characters too. > (.*) second parentheses uses “.” As any character except newline or carriage > return. The asterisk expands that to zero or more characters. > $ means the end of the line. > > The replacement is > \1 first parentheses “remembered” pattern > \2 follow that with the second > England end the replacement with a space and then the literal text “England” > > That’s mostly this grep/replace. You know the BBEdit Manual has lots more. > Bucky > > -- > 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 <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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/bbedit/49c92d66-cca0-41a0-8b5f-8e091541e5a2n%40googlegroups.com > > <https://groups.google.com/d/msgid/bbedit/49c92d66-cca0-41a0-8b5f-8e091541e5a2n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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/F5EFB300-FC31-4813-931B-9772D99BCB02%40gmail.com.
