有網友碰到過這樣的問題:如何用正則匹配後綴名不爲.jpg, .css, .js, .html, .htm, .png的文件,問題詳細內容爲:php
如何用正則匹配後綴名不爲.jpg, .css, .js, .html, .htm, .png的文件 ?css
,我搜你經過互聯網收集了相關的一些解決方案,但願對有過相同或者類似問題的網友提供幫助,具體以下:
解決方案1:
html
/.*\.(?:(?!(jpg|css|js|html|htm|png)).)+/
--- 共有 3 條評論 ---正則表達式
解決方案2:
apache
here you go...spa
find . -type f \( ! -iname "*.css" ! -iname "*.png" ! -iname "*.jpg" ! -iname "*.js" ! -iname "*.html" ! -iname "*.htm" \)htm
/\.(?:csv|xls|xlsx)$/iSystem.out.println("abc.jpg".matches(".*\\.(?i)jpg"));