5

When I use (?R) in a RegEx pattern in .NET, I get an ArgumentException:

Unrecognized grouping construct.

Does (?R) this have a different syntax in .NET?

1
  • 1
    You can use this page to see what language has what features by making use of the combobox above. .NET is listed as not being able to support (?R). Commented Aug 11, 2014 at 9:06

3 Answers 3

5

The closest thing to recursion that .NET has to offer for Regex is balancing group definition. Recursion is not directly supported in .NET.

Sign up to request clarification or add additional context in comments.

1 Comment

It's too bad it's not supported... However, with a balancing group definition I can do what I wanted.
3

According to the documentation, (?R) is not a valid construct in .NET regular expressions, nor is there any mention on that page of "recursive" or "recursion" so apparently this is not supported in .NET.

Comments

1

.NET doesn't support RegEX recursion but you can check this project to use PCRE in .NET
I hope it will be implemented in System.Text.RegularExpressions asap

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.