fork(5) download
  1. <?php
  2.  
  3. $string = "newboay1fineboy8badboiy12 boy4andothersfollows...";
  4. $string = preg_match_all("/(bo\pL+)\d+/", $string, $results, PREG_SET_ORDER, 0);
  5. foreach($results as $val){
  6. if($val[1] !== "boy") {
  7. echo $val[0] . "\n";
  8. }
  9. }
  10.  
Success #stdin #stdout 0.01s 23672KB
stdin
Standard input is empty
stdout
boay1
boiy12