d.shankar Posted October 5, 2007 Share Posted October 5, 2007 This regex seems to be correct but it displays a system generic error. Can somebody solve this ? $pattern='/((?:\\u00[a-f0-9]{2})|(?:\\x0*[a-f0-9]{2})|(?:\\\d{2,3})|(?:\W?=\W?\s*0x\w+))/'; Quote Link to comment https://forums.phpfreaks.com/topic/71933-solved-unexpected-error-in-regex/ Share on other sites More sharing options...
Rithiur Posted October 5, 2007 Share Posted October 5, 2007 PCRE does not support "\u". Quote Link to comment https://forums.phpfreaks.com/topic/71933-solved-unexpected-error-in-regex/#findComment-362316 Share on other sites More sharing options...
d.shankar Posted October 5, 2007 Author Share Posted October 5, 2007 Yeah how to fix this regex then ? Quote Link to comment https://forums.phpfreaks.com/topic/71933-solved-unexpected-error-in-regex/#findComment-362320 Share on other sites More sharing options...
Rithiur Posted October 5, 2007 Share Posted October 5, 2007 Umm.. Because your code is quite broken, it's hard to tell what it is supposed to even match. It would be easier to tell how to fix it, if I even know what it is supposed to do. But, I'm going to make a guess here: Your regex is supposed to match different kind of character representations. If that is correct, then mostly your problem is simply the fact that you are not taking into account the fact that \\ will be converted into \ because it simply escapes the \ character in the string. Thus, you pretty much just have too few backslashes there. Here it is fixed: $pattern='/((?:\\\\u00[a-f0-9]{2})|(?:\\\\x0*[a-f0-9]{2})|(?:\\\\\\d{2,3})|(?:\\W?=\\W?\\s*0x\\w+))/'; Quote Link to comment https://forums.phpfreaks.com/topic/71933-solved-unexpected-error-in-regex/#findComment-362342 Share on other sites More sharing options...
d.shankar Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks a lot rithiur. Quote Link to comment https://forums.phpfreaks.com/topic/71933-solved-unexpected-error-in-regex/#findComment-363190 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.