fork download
  1. <?php
  2.  
  3. if (
  4. '~(?(DEFINE)(?<content>\w+))(?><(?&content)>|\[(?&content)\]|\((?&content)\))~',
  5. '<123> [234] (45) 6 (<78>)',
  6. $m
  7. )
  8. )
  9. print_r($m);
  10.  
  11. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => <123>
            [1] => [234]
            [2] => (45)
            [3] => <78>
        )

    [content] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
        )

    [1] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
        )

)