Preg_match error on Windows only
Same version of smartpill on each platform - 1.5.0 - PHP Version 5.2.4
Here is some simple regex code to show the problem:
PHP_Execute( "
print( preg_match('/[0-9]/', '1') );
print(' - ');
print( preg_match('/[\d]/', '1') );
"
)
On the Mac, this correctly returns "1 - 1" as both expressions are essentially the same.
On Windows (XP SP2) however, I get "1 - 0".
Seems like the \d expansion is not working. Anyone got any clues as to why this might be the case?
Thanks
Simon
Success at last!
Looks like we finally have this one solved. Turned out to be an issue with PHP's build/config and nothing to do with PCRE. Anyway, we will have a new 2.0.1 release available shortly that includes this fix.
Regards,
Micah
No luck yet
We've been working on this and have tried many different approaches to compiling the PCRE extension on Windows but no luck yet. I understand this is an important issue, especially when using open source code, etc. where shorthand character classes are used. Just wanted to let people know that we're continuing to work on this.
Regards,
Micah
Update
Just thought I'd mention that this one just wasted a lot of development time. I'm using a fairly large set of classes written by someone else and the preg_match problem finally turned out to be the problem buried deep within.
However, tracking it down was incredibly tedious because no matter what I did, no error was reported. Error reporting is on and happily reporting other errors. This one however just causes the php to stop and return nothing (and no further output).
Also, I can confirm that the error doesn't manifest if using identical PHP from the command line. It only happens with the plugin and on Windows (tested XP and Server 2003 so far).
Cheers
Simon
Great - not just me then :)
Great - not just me then :)
Preg_match error on Windows only
Hello Simon,
Hmmm, I'm seeing the same thing here and in fact none of the predefined character classes seem to work on Windows (like \s, \w, etc.). I don't have a Windows copy of PHP installed at the moment but it would be interesting to test a regular version of PHP and see if the same issue is present.
I've put this on the list to investigate. Let me know if you find out more on your end. In the meantime, I guess it's important to use the equivalent expression instead of the shortcut.
Regards,
Micah