I have a $location.path()
that is of the following type of format:
/request/add/c3smsVdMHpVvSrspy8Vwrr5Zh8qSyP7q
I am interested in filtering the hash after /request/add/
to the following. As you can see, the last four chars are shown, but everything else before that is labeled as [FILTERED]
/request/add/[FILTERED]yP7q
I did some basic code which converts the hidden chars to #
, but I got stuck in trying to apply the string [FILTERED]
after the /request/add
.
old_path = $location.path()
path = old_path.replace(/.(?=.{4,}$)/g, '#');