- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
//if -behind- have double or more (\\) match it, but if (\) its one ignore it
//get -behind\\-
$str = 'hey look -behind\\- you';
//ignore -behind\-
$str = 'hey look -behind\- you';
preg_match_all('/\-(.*?)(?<!\\\{2})\-/', $str, $matched);
var_dump($matched);