I want to get the anchor in a URL, where the anchor (#text) can be in these formats:
https://example.com/#section3?a=1a&b=2b
https://example.com/#section3&a=1a&b=2b
https://example.com/?a=1a&b=2b#section3
https://example.com/&a=1a&b=2b#section3
So I would have to get the following in all cases:
#section3
Anchors in the URL can only contain ASCII characters, so I though this could be used for that.
I got this, and although it seems to work, it seems to be it can be done better and shorter?
#(.)*\?|#(.)*?\&|#(.)*