Jump to content
UBot Underground

Recommended Posts

I'm just trying to find a string to select the last half of a url. I want to trim off the text to the right of the last forward slash. I want this:

 

http://user.domain.com/post/11735684801/this-is-a-post

 

To turn into this

 

http://user.domain.com/post/11735684801

 

The flow I want to achieve is - start at the end, select everything back to the first slash. What I've come up with is this:

 

http://img84.imageshack.us/img84/7052/grepexample.jpg

 

With \x2f.+.$ - it ignores all the slashes to the first one, why? What am I doing wrong?

 

With [0123456789]\x2f.+.$ - I'm almost there, but I don't want the last number included.

 

I've spent way too much time with Photoshop to get a deep understanding of this programming stuff! :-P

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...