fork download
  1. <?php
  2.  
  3. $string = "111abc222 111deg222 111hij222";
  4. $pattern = "/111[a-z]+222/";
  5.  
  6. preg_match_all($pattern, $string, $matches);
  7.  
  8. print_r($matches);
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 111abc222
            [1] => 111deg222
            [2] => 111hij222
        )

)