//simple and useful.
^ :begainning of a line.
:/^love/
$ :end of a line.
:/love$/;/^$/
. :matches one character.
:/l..e/
* :matches one or more preceding characters.
:/*love/ matches begain with some space and followed by love.
[] :matches one character in the set.
:ls -l |grep "^[d]"
[x-y] :matches one character within a range in the set.
:/[a-zA-Z0-9]/
[^ ] :matches one character not in the set.
:/[^a-z]
/ :used to escape a meta character.
:/.
< :matches lines containing a word that begins with
://<love/
> :matches lines containing a word that end with
:/love/>/
/(../) :tags match characters to be used later.
://(love/)able/1er/
x{m,/} :matches repetition( again) of character x, m times.
x{m,n/}:matches repetition( again) of character x, m to n times.
博客介绍了正则表达式中多个元字符的匹配规则,如^表示行的开始,$表示行的结束,.匹配一个字符等,还说明了*、[]、[x - y]等元字符的作用,以及标签匹配字符的用法和字符重复匹配规则。

被折叠的 条评论
为什么被折叠?



