Recursive RegEx in .NET? (?R)

后端 未结 3 752

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

Unrecognized grouping construct.

Does (?R) this have a d

相关标签:
3条回答
  • 2020-12-11 08:21

    .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

    0 讨论(0)
  • 2020-12-11 08:31

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

    0 讨论(0)
  • 2020-12-11 08:36

    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.

    0 讨论(0)
提交回复
热议问题