作者: waker 時間: 2012-04-19 16:17
Interval expressions were not traditionally available in awk. They were added as part of the POSIX standard to make awk and egrep consistent with each other.
Initially, because old programs may use ‘{’ and ‘}’ in regexp constants, gawk did not match interval expressions in regexps. 作者: mgqw 時間: 2012-04-19 16:28 回復(fù) 2# waker
版主威武, 這么快就回答了!~作者: justlooks 時間: 2012-04-19 16:30
# echo "+++ abc"|awk --posix '/^\+{2,}/'
+++ abc 作者: waker 時間: 2012-04-19 16:32
說明你發(fā)了個經(jīng)帖作者: mgqw 時間: 2012-04-19 16:36
我有罪......作者: mpstat 時間: 2012-04-19 16:40
r{n,m} One or two numbers inside braces denote an interval expression. If there is one number in the braces, the preceding regular expression
r is repeated n times. If there are two numbers separated by a comma, r is repeated n to m times. If there is one number followed by a
comma, then r is repeated at least n times.
Interval expressions are only available if either --posix or --re-interval is specified on the command line.作者: yjcdoc 時間: 2012-04-19 17:44
用--re-interval 參數(shù)可以