Wonderful! My thanks go out to all who replied - especially Neil Faiman *(who was first to reply)* for his detailed and very clear explanation. Just what I needed. Grateful thanks, once again. Andy
On Friday, 21 April 2023 at 19:09:42 UTC+1 Neil Faiman wrote: > So you want to find all occurrences of a digit immediately followed by a > letter and insert a space between them? > > Get the search dialog. Check the Grep box. Clear the Case sensitive box. > > Find: (\d)([a-z]) > Replace: \1 \2 > > Click the Replace All button. > > Detailed explanation: > > - *\d* matches any digit. > - *[a-z]* matches any letter. > - *\d[a-z]* would match a digit immediately followed by a letter. > Parenthesizing the two parts of the search string, *(\d)([a-z])* does > the same search, but when it finds a match, it “captures” the substrings > that match the parenthesized components — I,e, the digit and the letter. > - In the replacement string, *\1* and *\2* stand for the captured > substrings that match the parenthesized sub patterns, i.e., the digit and > the letter. > - So the replacement string *\1 \2* stands for the matched digit, a > space, and the matched letter. > > > So if your input text is *123XyZ*, *(\d)* matches the *3 *and assigns it > to *\1*, *([a-z])* matches the *X* and assigns it to *\2*, and the the > string *3X* is replaced by *3 X*. > > Regards, > Neil Faiman > > On Apr 21, 2023, at 1:47 PM, 'Andy Nickless' via BBEdit Talk < > [email protected]> wrote: > > Forgive the level 0 question, but I want to find instances in a simple > text document where various figures have got up against some text, with no > space between them. (For example 123Xyz). > I want to keep the figures the same, and the following text the same, but > put a word space between them. (For example 123 Xyz). > > > -- 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/5ec7535f-3bcb-418e-99aa-e643edebef3bn%40googlegroups.com.
