I'm trying to write a regex to match part of a string that comes before '/' but also ignores any leading or trailing white space within the match.
So far I've got ^[^\/]*
which matches everything before the '/' but I can't figure out how to ignore the white space.
123 / some text 123
should yield
123
and
a test / some text 123
should yield
a test