Originally posted by 26933062 at 2008-5-10 10:45 PM:
可以匹配0次,也就是说 * 可以不匹配前面的字符,
那么为什么我用字母开头它又不能匹配呢?
echo a.123.2.3|findstr /r "^*\.*\.*\.*$"
它似乎只匹配点开头和数字开头,
findstr的帮助里面有答案:
* Repeat: zero or more occurances of previous character or class
^ Line position: beginning of line
$ Line position: end of line
^*
你这样写就表示要匹配以一位数字开头、后面跟0个或多个任意字符的行。