Since you only care about the last set of slashes, you start by matching anything
.*
then you want a literal slash
\/ (escaped since the slash would terminate the js regex)
now you want anything up to the next slash, which implies not a slash and _there must be something (one-or-more) and we'll put that in a capturing group so you can extract it.
([^/]+)
and followed by another literal slash
\/
then anything else (the file name?) that, again, does not include slashes
[^/]+
Putting that all together gives you the regex
/.*\/([^/]+)\/[^/]+/
and
"aa/bbbb/ccccc/eeee/fffff.jpg".match(/.*\/([^/]+)\/[^/]+/);
produces
["aa/bbbb/ccccc/eeee/fffff.jpg", "eeee"]
... the eeee is captured.
.htmland.propertiesare legal. How about/.*\/([^/]*)\/[^/]*/