Ubuntu中文论坛
致力于Ubuntu中文推广
http://forum.ubuntu.com.cn/
[问题]怎样判断一个文件名里是否包含某些扩展名?
http://forum.ubuntu.com.cn/viewtopic.php?t=55177
分页:
2
/
2
发表于 :
2007-05-23 1:20
由
alinmn
echo "abc.php" | grep '^\w\+\.\(php\|css\|txt\|htm\|html\)$'
不要中括号,不然按\或w匹配