If you only want to apply this to figures of a certain length (i.e. 3 or
more digits) so it would skip things like "3d" or 'B2B" or "23AndMe", you
can use curly brackets to specify a number of occurrences, like:

\d{2,]  <--matches 2 or more digits
\d{3,5} <--matches 3 to 5 digits

Kevin

On Fri, Apr 21, 2023 at 2:09 PM Neil Faiman <[email protected]> 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/BD13333E-702B-45C4-817D-1C7A41F2DB40%40faiman.org
> <https://groups.google.com/d/msgid/bbedit/BD13333E-702B-45C4-817D-1C7A41F2DB40%40faiman.org?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/CAKi-cftg1Tjh%2BVjYj6vkPx%3DNAxZFzSov3-SnO84jF7zeqLgTgw%40mail.gmail.com.

Reply via email to