preg_match("/foo1(.*)bar1/", $subject, $matches1);
preg_match("/foo2(.*)bar2/", $subject, $matches2);
preg_match("/foo3(.*)bar3/", $subject, $matches3);
I'm wondering how I can combine the three patterns, call preg_match
only once and put all the matches into one array? As you probably know, preg_match
doesn't accept an array as first parameter.