I am trying to come up with a regular expression in Perl matching multiple patterns and returning all of them like preg_match_all in PHP does.
preg_match_all
Here\'s w
The Perl equivalent to
preg_match_all('/(test|data|string)/', 'testdatastring', $m)
is
@m = ("testdatastring" =~ m/(test|data|string)/g);
The /g flag stands for global, so it returns a list of matches in list context.