2009年5月30日

Perl-compatible Regular Ex-pressions

Perl-compatible Regular Ex-pressions http://www.pcre.org/
Windows 版 http://gnuwin32.sourceforge.net/
安裝 Pcre for Windows 後,可以找到程式
C:\Program Files\GnuWin32\bin\pcregrep.exe
可將 C:\Program Files\GnuWin32\bin 加入環境變數 path 中
使用 pcregrep
Usage: pcregrep [OPTION]... [PATTERN] [FILE1 FILE2 ...]
例如要例出 a.txt 中有含數字的每一行
>pcregrep \d+ a.txt

沒有留言:

網誌存檔