reveiled Posted December 3, 2009 Share Posted December 3, 2009 I get this in my new Wordpress Install! What is wrong? Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in /home/haitimar/public_html/quepasodr/wp-includes/classes.php on line 210 Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in /home/haitimar/public_html/quepasodr/wp-includes/classes.php on line 211 210: if (preg_match("#^$match#", $request_match, $matches) || 211: preg_match("#^$match#", urldecode($request_match), $matches)) { Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/ Share on other sites More sharing options...
corbin Posted December 3, 2009 Share Posted December 3, 2009 What are you trying to do? That syntax is entirely wrong. ^ means starts with, and $ means ends with. Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/#findComment-970295 Share on other sites More sharing options...
cags Posted December 3, 2009 Share Posted December 3, 2009 if (preg_match("#^{$match}#", $request_match, $matches) || preg_match("#^{$match}#", urldecode($request_match), $matches)) { Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/#findComment-970336 Share on other sites More sharing options...
reveiled Posted December 3, 2009 Author Share Posted December 3, 2009 What are you trying to do? That syntax is entirely wrong. ^ means starts with, and $ means ends with. I just installed a Wordpress blog with 2 plugins (SImple Press Forum http://simplepressforum.com/ & Maintenance mode http://sw-guide.de/wordpress/plugins/maintenance-mode/ ) Everything was fine. Left the blog overnight, woke up in the morning & I had that! I checked other WP installs I have and line 210 & 211 are exactly the same as this one Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/#findComment-970450 Share on other sites More sharing options...
reveiled Posted December 3, 2009 Author Share Posted December 3, 2009 if (preg_match("#^{$match}#", $request_match, $matches) || preg_match("#^{$match}#", urldecode($request_match), $matches)) { Should I replace it with this one? Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/#findComment-970451 Share on other sites More sharing options...
cags Posted December 3, 2009 Share Posted December 3, 2009 My code assumes that you are trying to see if the value of the variable $match is at the start of the string $request_match. Quote Link to comment https://forums.phpfreaks.com/topic/183810-warning-preg_match-functionpreg-match-compilation-failed/#findComment-970453 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.