fork(1) download
  1. <?php
  2.  
  3. $re = '~(8768|9875|2353).*(?:\R(?!\R).*)*~iu';
  4. $str = '8768 text text
  5. text
  6.  
  7. 868123
  8. text
  9. text
  10. text.text
  11.  
  12. 9875 text
  13. text
  14.  
  15. 2353
  16. text
  17. text';
  18. $subst = '';
  19.  
  20. $result = preg_replace($re, $subst, $str);
  21.  
  22. echo "The result of the substitution is ".$result;
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
The result of the substitution is 

868123
text
text
text.text