I have the following RegEx that works in PHP, but I can't figure out how to convert it so that it works in JS.
$string='test/again/'
preg_replace('/[^\/]+\/$/', '', $string)
this takes this: test/again/
and makes it into: test/
Thanks for your help.