8👍
✅
Use [^/]+
instead of .+
.
As Chris Pratt notes below, .+?
will also work, as it is a “non-capturing” regex, which will match any character until a match for the following sub-expression. I generally prefer normal eager solutions to non-capturing solutions where possible, because they do not introduce multiple evaluation rules.
Source:stackexchange.com