KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to write a regex to get the filename from a url if it exists. This is what I have so far: (?:[^/][\d\w\.]+)+$ So from the url http://www.foo.com/bar/baz/filename.jpg , I should match filename.jpg Unfortunately, I match anything after the last / . How can I tighten it up so it only grabs it if it looks like a filename?
Tags (comma-separated)
Save Edits
Cancel