AudiS2 Posted December 2, 2010 Share Posted December 2, 2010 I am using a regex with /iumsU modifiers. On some servers this crashes PHP and I need to turn UTF8 off thus the modifier becoming /imsU I am wondering how can I detect the requirements for /u to work normally so I can dynamically adjust my regex? Cheers Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/ Share on other sites More sharing options...
requinix Posted December 2, 2010 Share Posted December 2, 2010 "Crash" how? An actual crash? Or /u just isn't supported? Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/#findComment-1142044 Share on other sites More sharing options...
AudiS2 Posted December 2, 2010 Author Share Posted December 2, 2010 Crash as in the script terminates, I assume because of mode not supported. But I can not find anywhere what are the requirements for /u searches Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/#findComment-1142137 Share on other sites More sharing options...
AudiS2 Posted December 3, 2010 Author Share Posted December 3, 2010 If that helps I discovered that it is not that PHP crashes but just preg_replace, returning an empty string with /u. Still looking for ideas! Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/#findComment-1142586 Share on other sites More sharing options...
AudiS2 Posted December 5, 2010 Author Share Posted December 5, 2010 Last bump! Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/#findComment-1143414 Share on other sites More sharing options...
requinix Posted December 6, 2010 Share Posted December 6, 2010 preg_replace, returning an empty string with /u. ...So it's not a crash. Not even close to a crash. Your expression isn't matching. preg_replace would have complained if you tried to use an invalid flag: look for error messages (if you don't see anything, check your error_reporting and display_errors settings)> Link to comment https://forums.phpfreaks.com/topic/220413-use-of-utf8-modifier-in-regex-crashes-php/#findComment-1143445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.