Using a named capture groups causes a different match

Using a named capture groups causes a different match

Given Regex: ^(Start\.)?(.+?)(\.|\.\2)?(End)?$

Given Regex: ^(Start\.)?(.+?)(\.|\.\2)?(End)?$

Test Input: Start.Word.WordEnd

I get Word for Group "2":

However if I change the regex to also include a name for the captured group, I get a different result:

Regex: ^(Start\.)?(?<capturedGroup>.+?)(\.|\.\2)?(End)?$

capturedGroup is Word.Word

This is in .NET 4.7.2 (I also did the test in with the same result). Links:

first case:

second case:

I tested this in (set as PHP) and I get the expected result (both are Word), so I expect this to be a .NET issue? Please help.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Variable Introduction in C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a speci...

Taking Input From User In C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE In C#, the simplest method to get input from the user is by using the ReadLine() method of the Console class. However, Rea...