What is PCRE compatible syntax? And is C # PCRE compatible?

What is PCRE compatible syntax? And is C # PCRE compatible? From Wikipedia I found this:

Perl Compatible Regular Expressions (PCRE) is a regular expression C library inspired by the Perl regular expression features of the programming language written by Philip Hazel since the summer of 1997. The PCRE syntax is much more powerful and flexible than any of the POSIX regular expression options and many classic regular expression libraries. The name is misleading, since PCRE and Perl each have capabilities not shared by the other.

A source

+6
source share
1 answer

Regular replicas # have a common syntax with PCRE regular expressions. Most functions overlap, but both libraries retain their specifics:

A few examples:

PCRE

  • Recursion support
  • Supports reverse traffic management verbs
  • Supports constructs such as (?(DEFINE) ... )
  • Support for advanced options
  • Offers DFA parsing mode
  • Supports partial matches
  • Support \K
  • Supports X++ shorthand syntax (equivalent (?>X+) )

.NET

  • Supports capturing and duplication of named groups
  • Balance Group Support
  • Variable length lookbehind support

This list is not exhaustive. You can compare both options on this page and on the home pages.

Given the differences, I wanted to be able to use PCRE regular expressions from .NET and recently started PCRE.NET , which is a wrapper project. It is not finished yet, but is starting to be used.

+11
source

Source: https://habr.com/ru/post/977066/


All Articles