\[[^\s]*\s
.*
is greedy and will eat everything, including spaces, to the last space character. If you replace it with \S*
or [^\s]*
, it will only match a fragment of zero or more characters except spaces.
It may be necessary to mask the open bracket. If you negate \ s with ^ \ s, the expression should have everything except spaces, and then a space, which means up to the first space.
source share