fork download
  1. <?php
  2.  
  3. $re = '/(?:\|product|\G(?!\A))(?<product>#[^|#]+)/';
  4. $str = '|product#houtprint#laserprint|materiaal#hout';
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches["product"]);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => #houtprint
    [1] => #laserprint
)