fork(1) download
  1. <?php
  2.  
  3. $string = <<<DATA
  4.  
  5.  
  6.   [SYS 1]Page 1 from 2:[/SYS]
  7.  
  8.   Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard ...
  9.  
  10.   [SYS 2]Page 2 from 2:[/SYS]
  11.  
  12.   It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
  13. DATA;
  14.  
  15. $regex = '~\[SYS[^]]*\](.+?)\[/SYS\]~';
  16. $string = preg_replace($regex, '$1', $string);
  17.  
  18. echo $string;
  19.  
  20. ?>
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout

    Page 1 from 2:

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard ...

    Page 2 from 2:

    It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.