Skip to content

Instantly share code, notes, and snippets.

@xexi
Last active July 31, 2017 07:59
Show Gist options
  • Save xexi/b2844ebd68ec7a5d4120f7d53be654ca to your computer and use it in GitHub Desktop.
Save xexi/b2844ebd68ec7a5d4120f7d53be654ca to your computer and use it in GitHub Desktop.
js extract file ext
var test = 'myfile.txt';
console.log(test.match(/\.[0-9a-z]+$/i)[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment