Here is the code I'm trying to run:
$str = 'a,b,c,d';
return preg_split('/(?<![^\\\\][\\\\]),/', $str);
As you can see, the regex is used here:
/(?<![^\\][\\]),/
This is a simple fixed-length negative lookbehind for which "is preceded by something that is not a backslash, and then something!".
This regex works great at http://www.phpliveregex.com
But when I go and actually try to run the above code, I spat out an error:
Warning: preg_split() [function.preg-split]: Compilation failed: lookbehind assertion is not fixed length at offset 13
To make matters worse, one programmer tested the code on his 5.4.24 PHP server, and it worked fine.
This makes me think that my problems are related to my server configuration and I have very little control. I was told that my version is PHP, if 5.2. *
- / preg_replace(), ?