Tutorial by Examples

Given the flavors, the named capture group may looks like this: (?'name'X) (?<name>X) (?P<name>X) With X being the pattern you want to capture. Let's consider the following string: Once upon a time there was a pretty little girl... Once upon a time there was a unicorn with an h...
As you may (or not) know, you can reference a capture group with: $1 1 being the group number. In the same way, you can reference a named capture group with: ${name} \{name} g\{name} Let's take the preceding example and replace the matches with The hero of the story is a ${subject}. T...

Page 1 of 1