fork download
  1. <?php
  2. $re = "#(?>ab|cr)\d+#";
  3. $str = "rw200-208-ab66\nfg200-cr30-201";
  4. preg_match_all($re, $str, $matches);
  5. print_r($matches[0]);
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
Array
(
    [0] => ab66
    [1] => cr30
)