Get last part of url using a regex

user86834

How do I get the last part of the a URL using a regex, here is my URL, I want the segmeent between the last forward slash and the #

http://mycompany.com/test/id/1234#this

So I only want to get 1234.

I have the following but is not removing the '#this'

".*/(.*)(#|$)",

I need this while indexing data so don't want to use the URL class.

jtahlborn

how about:

".*/([^/#]*)(#.*|$)"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related