Regular Expression for getting everything after last slash
In original question, just a backslash
is needed before slash
, in this case regex will get everything after last slash
in the string
([^\/]+$)
No, an ^
inside []
means negation.
[/]
stands for 'any character in set [/]'.
[^/]
stands for 'any character not in set [/]'.