DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Thomas has posted 33 posts at DZone. View Full User Profile

Regular Expression Matching A File Name That Does Not End With A Specific Extension

05.17.2011
| 4871 views |
  • submit to reddit
        Example with the ".writing" extension: 
.+(?<!\.writing)
    

Comments

Snippets Manager replied on Thu, 2011/06/02 - 9:31am

ls|perl -nle 'print if !/[.](pl|txt|t)$/'

Snippets Manager replied on Thu, 2011/06/02 - 9:31am

ls|perl -nle 'print if !/[.]writing$/'