I’m getting errors that look like they have to do with the \ character in regular expressions. The two I have encountered so far are openemr/interface/main/myadmin/libraries/common.lib.php line 1082
and
openemr/interface/main/myadmin/main.php line 246
Is there a setting I’m missing, because these don’t seem to be bugs that could be passed up.
Looking at http://www.php.net/manual/en/ref.regex.php, the second “warning” is curious. It’s as if there are different ways you can build regular expression support and they are not compatible with each other.
Just a thought. I guess what I’d do is play with the regex’s.
I played with the one that gave me the error message and it seemed to work, but another one had a problem. That’s why the problem seemed more general. I wouldn’t mind playing with the regex’s, I just don’t know what they are supposed to be matching specifically – I’m afraid of guessing what the regex is trying to do. Basically with the first one I just made the slash into a triple slash, so it went from
“^|[^\]” to “^|[^\\\]”. But this doesn’t really seem to make much sense as a matcher. Why put the ^ outside the brackets?
I’m also afraid to mess with php regex settings because I have other programs running that are working.
I reread it and thought I wasn’t clear.
Basically, I interpreted the original regular expression to mean “the beginning of a string or anything but a back slash” so I made it three backslashes so that it wouldn’t escape out the bracket when php read the string and when the regex engine got a hold of it. But I can’t figure out if that is specifically what the programmer had in mind.
The regex strings that you referred to are single-quoted in the PHP code. This means that PHP should not be escaping out the bracket. In theory, ‘\]’ and ‘\\]’ should be identical (the backslash will escape either a single quote or another backslash but nothing else). ‘\\\]’ will, I guess, be interpreted by PHP as ‘\\]’, as will ‘\\\\]’.
So again, I think this is some sort of PHP bug and unfortunately it will take some effort to solve your problem with reasonable confidence.