Re: The difference between ereg and preg?
| From: | Dave M G | Date: | Fri, 04 Aug 2006 09:52:16 +0000 |
| Subject: | Re: The difference between ereg and preg? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240097@lists.php.net to get a copy of this message | ||
Chris, Ligaya, Dave,
Thank you for responding. I understand the difference in principle between ereg and preg much better now.
Chris wrote:
! in perl regular expressions means "not" so you need to escape it: \! Still, when including that escape character, the following preg expression does not find any matching text:preg_replace("/<\!DOCTYPE(.*)<ul>/", "", $htmlPage); Whereas this ereg expression does find a match: ereg_replace("<!DOCTYPE(.*)<ul>", "", $htmlPage); What do I need to do to make the preg expression succeed just as the ereg expression does? Thank you for your time and advice. -- Dave M G