.netregexperlregexp-grammars

Is there anything like perl's Regexp::Grammars or labeled subpatterns in .NET?


I really like perl's Regexp::Grammars module. Is there anything like this for .NET?

I'd really like to use a recursive descent parser in a regex style way (eg searching for a matching pattern through a large document) in C#, and be able to express that pattern recursively.

Update After reading this little gem from brian d foy, I discovered that perl 5.10 supports labeled subpatterns using (?&NAME). PCRE now has a Nuget package, and PCRE supports named/labeled subpatterns.


Solution

  • Perl5 Regexp::Grammars is modeled after Perl6 grammars.

    Niecza is a Perl6 implementation that implements grammars and targets the CLI, which .NET also does.