> On Mar 16, 2022, at 5:24 PM, Patrick Woolsey <[email protected]> wrote:
>
>>
>> In *Find: ^(\d+?)\.1 *what is the purpose of the question mark? I know what
>> *\d+* does.
>>
>
> It makes matching "non-greedy", so the pattern won't try to extend beyond the
> first possible match.
In this particular case, the ? doesn’t have actually have any effect — the
longest string of digits that is immediately followed by a dot is exactly the
same as the shortest
String of digits that is immediately followed by a dot, since a dot is not a
digit. But the non-greedy modifier can be essential when a repeated wild-card
pattern would otherwise match right over what is supposed to be the terminator.
Regards,
Neil Faiman
--
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/3B57FAE8-9B70-4B23-8B6D-6EE73730CA74%40faiman.org.