Regex match dash optional flag

I’m trying to interpret user commands as dash optional flag.

{run -o -f -a file1 file2}

Something like this:

/{run (-o|-f) (w+) (.+?)}/g;

Is very limiting with only 1 choice of flag, how do I let them flag any amount, spit out the flags into groups, and not worry about a set amount of whitespace in between.

string = "{run    -a  file1 file2}"
string = "{run    -a -o -f  file1 file2}"
string = "{run -f-a-o  file1 file2}"

string.match(regex) should output each flag and each file name.