Regex To Match Strings After The Last Slash In A String

Category: URI

A regular expression that matches everything after the last slash in a string (like a URL or a file/folder path).

Can be useful in finding out file names or query strings in a URL.



  • /path/to/regex


  • /path/to/regex/

See Also:

Rate This Regex
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.