Extra g flag returns the list of all matched strings

>>> "ala ma kota" == rex('/(\w+)/g')
['ala', 'ma', 'kota']

The same in Perl:

perl> "ala ma kota" =~ /(\w+)/g;
("ala", "ma", "kota")