grep 正则问题 this version of PCRE is compiled without UTF support

问题

在使用grep -P,出现如下报错:

grep: this version of PCRE is compiled without UTF support

原因

有些系统支持的正则规范不同。

解决办法

使用egrep或grep –E 代替。

正则表达式分类

  • 基本正则表达式:BRE

    grep ,egrep –G

  • 扩展正则表达式:ERE

    grep -E, egrep

扩展正则表达式extended regular expression比基本正则表达式basic regular expression的表达更规范。

参考

https://www.cnblogs.com/python-gm/p/6940756.html

原文地址:https://www.cnblogs.com/lanyangsh/p/8727147.html