##
while (... not finished string ...) {
if (my @m = ($a =~ /\G(\w+) ?/gc)) {
push @s, @m;
} elsif ... other stuff not important
}
####
while (... not finished string ...) {
if (my @m = ($a =~ /\G(?:(\w+) ?)+/c)) {
push @s, @m;
} elsif ... other stuff not important
}