fork(1) download
  1. <?php
  2.  
  3. $text = '__This_is__ a __test__';
  4. preg_match_all('/__(?:(?!__).)+__/', $text, $matches);
  5. print_r($matches);
Success #stdin #stdout 0.04s 25728KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => __This_is__
            [1] => __test__
        )

)