This regex will also work fine.
Regex: ^[^\/]+
It will start matching from beginning of string until a /
is found.
^
outside character class []
is anchor for beginning of string.
While ^
inside character class means negated character class.
Regex101 Demo