概念:
PCRE (Perl Compatible Regular Expressions):
与Perl兼容的正则表达式,由C实现。但也不是完全相同,与Perl的正则表达式还是略有不同。
https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
正则表达式: is, in theoretical computer scienceand formal language theory, a sequence of characters that define a search pattern. Usually this pattern is then used by string searching algorithms for "find" or "find and replace" operations on strings.
https://en.wikipedia.org/wiki/Regular_expression
形式语言:formal language 是用精确的数学或机器可处理的公式定义的语言。
https://zh.wikipedia.org/wiki/%E5%BD%A2%E5%BC%8F%E8%AF%AD%E8%A8%80
内容:
PCRE分两个大版本,PCRE与PCRE2, PCRE的后续版本只修改bug而不再增加新特性。
PCRE2的文档:https://www.pcre.org/current/doc/html/
PCRE2 入门导读:https://www.pcre.org/current/doc/html/pcre2.html
PCRE release:https://ftp.pcre.org/pub/pcre/
写了个简单的小例子:
https://github.com/tony-caotong/knickknack/tree/master/examples/pcre2