正则表达式 – 什么是’我的系统’提供的正则表达式库?

GNU的较少实用程序的手册页有关于搜索的以下内容
/pattern
    Search forward in the file for the N-th line containing the pattern.  N
    defaults to 1.  The pattern is a regular expression,as recognized by the
    regular expression library supplied by your system.

我在各种系统上使用的少:我的个人Ubuntu笔记本电脑,我的CentOS云服务器,在Cygwin工作,等等.我不断想做一些像负面的前瞻和其他花哨的东西,但我不知道什么是正则表达式要使用的语法我怎么知道?

它是一个编译时参数. less的./configure脚本知道with-regex = LIB参数.

这是上游软件包的README的引用:

–with-regex=lib

Specifies the regular expression library used by less for pattern
     matching.  The default is "auto",which means the configure program 
     finds a regular expression library automatically.  Other values are:
        posix          Use the POSIX-compatible regcomp.
        pcre           Use the PCRE library.
        regcmp         Use the regcmp library.
        re_comp        Use the re_comp library.
        regcomp        Use the V8-compatible regcomp.
        regcomp-local  Use Henry Spencer's V8-compatible regcomp
                       (source is supplied with less).

所以你需要知道’./configured’有多少.我在Debian / Ubuntu上进行了调查.他们使用POSIX正则表达式lib.

我仍然在寻找一种通过脚本动态检测它的方法

相关文章

一、校验数字的表达式 1 数字:^[0-9]*$ 2 n位的数字:^d{n}$ 3 至少n位的数字:^d{n,}$ 4 m-n位的数字...
正则表达式非常有用,查找、匹配、处理字符串、替换和转换字符串,输入输出等。下面整理一些常用的正则...
0. 注: 不同语言中的正则表达式实现都会有一些不同。下文中的代码示例除特别说明的外,都是使用JS中的...
 正则表达式是从信息中搜索特定的模式的一把瑞士军刀。它们是一个巨大的工具库,其中的一些功能经常...
一、校验数字的表达式 数字:^[0-9]*$ n位的数字:^\d{n}$ 至少n位的数字:^\d{n,}$ m-n位的数...
\ 将下一字符标记为特殊字符、文本、反向引用或八进制转义符。例如,“n”匹配字符“n”。“\n...