How to use regular matching suffix names not. jpg,. css,. js,. html,. htm,. png files

Source: Internet
Author: User

Some netizens have encountered such a problem: how to use regular matching suffix name is not. jpg,. css,. js,. html,. htm,. png files, the problem details are:

How do I use regular matching suffix names for. jpg,. css,. js,. html,. htm,. png files?

, I search you through the Internet to collect some of the relevant solutions, hope to have the same or similar problems to help users, as follows:

Solution 1:

---total 3 reviews---

    • Chief of the skin find. -type f-name "*.odt"-o-name "*.exe" (4 years ago) reply
    • Gross find is not paying for this complex regular (4 years ago) reply
    • Patriot Find/usr/local/apache2/htdocs-type F-regex '. *\. (?:(?! (Jpg|css|js|html|htm|png)).) + ' seems not work (4 years ago) reply


Solution 2:

Here you go ...

Find. -type f \ (!-iname "*.css"!-iname "*.png"!-iname "*.jpg"! "-iname" *.js "!-iname" *.html "!-iname" *.htm "\)

Regular expressions determine if the file name suffix is csv xls xlsx
/\. (?: csv|xls|xlsx) $/i
System.out.println ("Abc.jpg". Matches (". *\\." (? (i) JPG "));

How to use regular matching suffix names not. jpg,. css,. js,. html,. htm,. png files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.