in reply to Regex to extract multiple occurrences

my (@rep) = /(?:It contains\s+|\G)(?:([^,.\s]+)[,.]\s)/g;
perl -d DB<1> $_ = "This is list number 12. It contains apples, pears, peach +es. Total cost is 5."; DB<2> x /(?:It contains\s+|\G)(?:([^,.\s]+)[,.]\s)/g 0 'apples' 1 'pears' 2 'peaches'

Starting after 'It contains ', this captures anything that isn't a dot, comma, or space that is followed by a dot or comma followed by space. Requiring that a space follows the matched dot or comma eliminates '5.' from the results.