map over matches of a regular expression