<?php $s = 'q|aaa/aaa|bbb/bbb|ccc/ccc'; $pattern = '~ (?!\A) \| \K [^|/]+ / [^|/]+ (?: \z (*:END) )? | \A [^|/]+ ~Ax'; if (preg_match_all($pattern, $s, $m) && isset($m['MARK']) ) { $result = $m[0]; print_r($result); }
You have javascript disabled. You will not be able to edit any code.