2008-01-25

学习shell咯4

关键字: shell regex
vi,grep,sed和awk是Unix/Linux下处理文本的最重要的工具,而它们都与正则表达式密不可分

Regular Expression Metacharacters
^         Beginning-of-line anchor
$         End-of-line anchor
.         Matches one character
*         Matches zero or more of the preceding characters
[]        Matches one in the set
[x-y]     Matches one character within a range in the set
[^]       Matches one character not in the set
\         Used to escape a metacharacter
\<        Beginning-of-word-anchor
\>        End-of-word anchor
\(..\)    Tags match characters to be used later
x\{m\}    Repetition of character x, m times
x\{m,\}   Repetition of character x, at least m times
x\{m,n\}  Repetition of character x, at least m and not more than n times.
评论
发表评论

您还没有登录,请登录后发表评论

hideto
搜索本博客
我的相册
A6bdc31c-c66e-468e-961e-9cc721e82adc-thumb
screenshot
共 1 张
存档
最新评论