I don’t know if you are familiar with URL structure or not, but for anybody who is not, these links may help understanding them more…once I understood URL structure I was able to make much more use of it in my apps and I do it constantly.
I found an easier way, you can use split by # and then pick the item number. On the topic above it would be split by # and item#2:find and replace: #token= by —> Leave Empty