I'm using a custom program that parses a script based on strings between ~'s. This is what I need to do:
Take this string for example:
$string = "~Blah, blah, blah. j123, blah, blah.~
j532
~Blah, j392.~";
Now I need to preg_replace that string so it becomes this:
$string = "~Blah, blah, blah. 123, blah, blah.~
j532
~Blah, 392.~";
So, basically I need to replace any numerical reference that is prepended by a j only if it's between two tildes.
I've tried numerous things, including look ahead and behind assertions, but I can't get it to work.
Thanks for any help.