1. 程式人生 > >grep 正則問題 this version of PCRE is compiled without UTF support

grep 正則問題 this version of PCRE is compiled without UTF support

grep out pre express mark href ssi uri .html

問題

在使用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

grep 正則問題 this version of PCRE is compiled without UTF support