less 命令中的正则表达式搜索

xpt*_*xpt 4 linux unix search regex less

到底支持哪种正则表达式less搜索(例如我可以使用\d+)?

man less对此并不清楚,而且我主要的谷歌搜索也没有返回太多好的结果。谢谢。

Doc*_*ird 5

Less 使用随您的系统一起编译的正则表达式库。

有时您可以使用 --version 选项找出它是哪个版本:

less --version
Run Code Online (Sandbox Code Playgroud)

第一行可能会告诉您它是用什么编译的,例如:

less 481 (PCRE regular expressions)
Copyright (C) 1984-2015  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less
Run Code Online (Sandbox Code Playgroud)

有关该主题的更多信息,请访问:/sf/ask/1028885511/