Skip to content

Instantly share code, notes, and snippets.

@thinkerbot
Created October 28, 2013 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkerbot/7201236 to your computer and use it in GitHub Desktop.
Save thinkerbot/7201236 to your computer and use it in GitHub Desktop.
Positive match for files not matching '.*\.example'
[
"abc",
"abc.s",
"abc.ex",
"abc.exs",
"abc.exa",
"abc.exas",
"abc.exam",
"abc.exams",
"abc.examp",
"abc.examps",
"abc.exampl",
"abc.exampls",
"abc.example",
"abc.examples",
"abc.csv"
].map {|f| f =~ /\.([^e].*|e([^x].*|x([^a].*|a([^m].*|m([^p]|p([^l].*|l([^e].*|e.+$|$)|$)|$)|$)|$)|$)|$)/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment