I would like to replace “:” with “\xEF\xBC\x9A” however, I do not want to do this for : that follows “http”, “https”, and string with the format of @[{numbers}:{numbers}:{some text}].
What I have doesn’t really work as (?<!@\[\d) does not check what’s after it. My current implementation only work for something like @[1:2:text]. Thanks!
$string=preg_replace('#(?<!https)(?<!http)(?<!@\[\d)(?<!@\[\d:\d):#', "\xEF\xBC\x9A", $string);
Try this: