有网友碰到过这样的问题:如何用正则匹配后缀名不为.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"));