kiran14 Posted July 10, 2014 Share Posted July 10, 2014 Hi, I don't know much about php. Recently my host updated php version to 5.4 and i function eregi() is deprecated errors, so after some googling, replaced it with preg_match but i am stuck with errors Code: preg_match("^ and", "", $mid_str) Error: Warning: preg_match(): No ending delimiter '^' found Tried the following method but not working preg_match("/^ and/", "", $mid_str) Can you guys help me with correct code? Thanks for looking. Quote Link to comment https://forums.phpfreaks.com/topic/289658-help-with-preg_match-please/ Share on other sites More sharing options...
.josh Posted July 10, 2014 Share Posted July 10, 2014 I envision a future where everybody will actually read stickies and the world will be a better place. Then I wake up and laugh at that absurd fantasy. http://forums.phpfreaks.com/topic/268091-ereg-and-deprecated-error/ Quote Link to comment https://forums.phpfreaks.com/topic/289658-help-with-preg_match-please/#findComment-1484562 Share on other sites More sharing options...
.josh Posted July 10, 2014 Share Posted July 10, 2014 Also, adding the / delimiters should have gotten rid of the warning. So if it's still not working, then that's a different issue and your code probably wasn't working as intended even with eregi. For starters, you are providing an empty string as the 2nd arg. that is the "source" string to match stuff from, in both eregi and preg_match. Your pattern isn't going to match anything in an empty string.. Also, you didn't make the preg_match version case-insensitive (read the sticky link). Beyond that.. you're going to have to provide more details than "not working". Quote Link to comment https://forums.phpfreaks.com/topic/289658-help-with-preg_match-please/#findComment-1484565 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.