I have a string with the form of a b/c\/d\/e/f
. I'm trying to split the string on the non-escaped forward slashes.
I have this regex so far (?:[^\\/])/
. However it consumes the last character preceding the /
. So if I'm doing a replace with "#" instead of a split, the string looks like a #c\/d\/#f
. In the case of the split, I get the strings separated the same with the last character being consumed.
I tried using a non capturing group but that doesn't seem to do the trick either. Doing this in javascript.