gee Posted October 3, 2009 Share Posted October 3, 2009 Hi I am trying to convert to the preg_match function form the ereg funcntion, but can't get past this message: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash return (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])); return (preg_match('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])); Any help would be much apperciated. Quote Link to comment https://forums.phpfreaks.com/topic/176337-problem-with-preg_match/ Share on other sites More sharing options...
Mchl Posted October 3, 2009 Share Posted October 3, 2009 preg functions need so called delimiter around regular expression. Choose any character that is unlikely to appear in matched string. For example: preg_match('#MSIE ([0-9].[0-9]{1,2})#', $_SERVER['HTTP_USER_AGENT']); Quote Link to comment https://forums.phpfreaks.com/topic/176337-problem-with-preg_match/#findComment-929538 Share on other sites More sharing options...
gee Posted October 3, 2009 Author Share Posted October 3, 2009 Thank you very much for your help. Quote Link to comment https://forums.phpfreaks.com/topic/176337-problem-with-preg_match/#findComment-929673 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.