Regular Expression not finding backslash

Hi there! I am having a problem with regular expressions.
I want to have an expression that will find a minus sign (-) without a backslash before it. For example:
“-” would not be found
“-” would be found and
“-” would be found because the backslash is after the minus sign.
The code for preg split:
$explodeaddons = preg_split("/[^\]-/", $isdisplayarticlewritten[8]);
Looks like it would work but does not. I even escaped the backslash. If anyone could help that would be great as I have searched the net and haven’t found what I am looking for. I tried one, two and three backslashes before the end of the character class.

Thanks for your help!

Someone help me please??

Ok never mind I have it, the correct match is:
$test = preg_split("/[^\]-/", “I have a minus - right here and a slash minus - right here.”);

Sponsor our Newsletter | Privacy Policy | Terms of Service