- preg_match: documentation ( source)
- print_r: documentation ( source)
- array_shift: documentation ( source)
<?php
$re = '/\[\s*([^][|]*?)\s*\|\s*([^][]*?)\s*]/m';
$str = 'RE: Reply to me [Quote #341 | some-site]';
if (preg_match($re, $str, $match)) {
array_shift($match);
print_r($match);
}