Skip to content

Instantly share code, notes, and snippets.

@calebhearth
Created March 10, 2012 19:07
Show Gist options
  • Save calebhearth/2012537 to your computer and use it in GitHub Desktop.
Save calebhearth/2012537 to your computer and use it in GitHub Desktop.
t = [ '/', '/start/somethingelse/1', '/upload' ]
for (d in t) { result = t[d].match( /\/([a-z]+)?(\/(.*)?)?/i ); console.log(result[1], result[3]) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment