Say I have the following:
This path could be anything, we basically want to get the
You could use replace() which is like PHP's preg_replace() (it too accepts a PCRE, with some limitations such as no look behinds)...
str.replace(/.*\//, '')
jsFiddle.
Alternatively, you could use...
str.split('/').pop();