I think the problem is that the {2} calling for a repetition of the previous
pattern is outside the parentheses which signal the capture. You can use a
non-capturing group (?: ) to group patterns without creating another capture.
And then wrap the entire new expression with the repetition in parentheses so
its entirety becomes the first capture.
((?:\d{3}[-.]){2})(\d{4})
Hope this helps,
[fletcher]
> On Mar 1, 2020, at 4:28 AM, 'anotherhoward' via BBEdit Talk
> <[email protected]> wrote:
>
> In the Pattern Playground, I am running this pattern -> (\d{3}[-.]){2}(\d{4})
> with the data shown below.
>
> Here is my input data:
> 123.179-9876
> 123.456-9876
> 123-456-9870
> 126-456-987
> 1257-456--0
> 123-456
> 123450000
>
> Three capture groups are shown in the Capture groups box.
> <Screen Shot 2020-03-01 at 7.17.44 AM.png>
>
>
>
> In Capture group 1, I expected the result to be at least `123.` followed by
> '.179-`, not just `179-`.
>
>
>
> Why is only `179-` displaying?
>
>
>
> My Replace pattern is `\0`.
>
>
>
> --
> 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/f4f6710d-bb51-4c21-9270-e43b6c9eb2c6%40googlegroups.com
>
> <https://groups.google.com/d/msgid/bbedit/f4f6710d-bb51-4c21-9270-e43b6c9eb2c6%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <Screen Shot 2020-03-01 at 7.17.44 AM.png>
--
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/1AF2B923-2314-4A83-9D73-E8F3BD52462F%40cumuli.com.