Skip to content

Instantly share code, notes, and snippets.

@cloudrain21
Created April 11, 2016 21:15
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 cloudrain21/dc08fddfc79ecec085ade616d960c8e7 to your computer and use it in GitHub Desktop.
Save cloudrain21/dc08fddfc79ecec085ade616d960c8e7 to your computer and use it in GitHub Desktop.
Extract filename only from path
var fileName = fPath.match(/[-_\w]+[.][\w]+$/i)[0];
var fileName = fPath.split('/').pop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment