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

前端之家收集整理的这篇文章主要介绍了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.f2er.com/regex/357556.html

猜你在找的正则表达式相关文章