r{n}
r{n,}
r{n,m}
One or two numbers inside braces denote an interval expression. If there is one number in thebraces, 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 com-mand line.
[root@localhost ]# echo love-qq007-9w | awk '/love-qq[0-9][0-9][0-9]-[0-9]w/'
love-qq007-9w
[root@localhost ]# echo love-qq007-9w | awk --posix '/love-qq[0-9]{3}-[0-9]w/'
love-qq007-9w
阅读(1681) | 评论(0) | 转发(0) |