SyntaxFix
Write A Post
Hire A Developer
Questions
Should be
~/([^/]*)$~
Means: Match a / and then everything, that is not a / ([^/]*) until the end ($, "end"-anchor).
/
[^/]*
$
I use the ~ as delimiter, because now I don't need to escape the forward-slash /.
~