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. 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']); 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. Link to comment https://forums.phpfreaks.com/topic/176337-problem-with-preg_match/#findComment-929673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.