gregdavidson Posted February 13, 2013 Share Posted February 13, 2013 Hi, I'm currently using a script called Dodos Mail and I tried to fix an error that was getting for "eregi" which I changed to "preg_match". But the old error was replaced with this new error. Warning: preg_match() [function.preg-match]: Empty regular expression in /home/content/23/10513123/html/dodosmail.php on line41 Here's line 41 where I'm getting that error: if (preg_match("\r",$_POST['your_email_address']) || preg_match("\n",$_POST['your_email_address'])){ Any help you guys can give me would be greatly appreciated. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/274429-preg_match-empty-regular-expression/ Share on other sites More sharing options...
scootstah Posted February 13, 2013 Share Posted February 13, 2013 Regex in the preg_ functions need delimiters. So try this: if (preg_match("/\r/",$_POST['your_email_address']) || preg_match("/\n/",$_POST['your_email_address'])){ By the way, you can simplify this to: if (preg_match("/\r|\n/",$_POST['your_email_address'])){ Quote Link to comment https://forums.phpfreaks.com/topic/274429-preg_match-empty-regular-expression/#findComment-1412164 Share on other sites More sharing options...
gregdavidson Posted February 13, 2013 Author Share Posted February 13, 2013 Hey thanks man! I'm actually selling the website with this error and the buyer was refusing to pay in full until it was fixed. You answered my question just in time and I just got paid. Quote Link to comment https://forums.phpfreaks.com/topic/274429-preg_match-empty-regular-expression/#findComment-1412166 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.