I want to capture a pattern upto but not including the first instance of an optional other pattern with preg_match, eg:
ABCDEFGwTW$%
Another way to do it:
$str = 'Q$TQ@#%GEFGw35hqb'; $res = preg_split('/EFG/', $str); print_r($res);