fork download
  1. <?php
  2.  
  3. $re = '/^BEGIN_TAG:\W?(.*)/m';
  4. $str = 'BEGIN_TAG: Text To Capture
  5. WRONG_TAG: Text Not to Capture';
  6. preg_match_all($re, $str, $matches);
  7. print_r($matches[1]);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Text To Capture
)