sed中可直接使用的RE: (用\转义前是RE字符,转义后是普通字符)
* . ^ $ [ ] \
\w ( 相当于[A-Za-z_] ) \W ( 相当于[^A-Za-z_] )
sed中需转义使用的RE: (用\转义前是普通字符,转义后是RE字符)
+ ? { } ( ) | < >
这个真的有点烦人的,困惑了我好久
Basic vs Extended Regular Expressions
In basic regular expressions the meta-characters ?, +, {, |, (, and )
lose their special meaning; instead use the backslashed versions \?,
\+, \{, \|, \(, and \).---以上来自man grep 中的REGULAR EXPRESSIONS
转自
阅读(861) | 评论(0) | 转发(0) |