Re: The difference between ereg and preg?
| From: | Jochem Maas | Date: | Fri, 04 Aug 2006 12:13:24 +0000 |
| Subject: | Re: The difference between ereg and preg? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240107@lists.php.net to get a copy of this message | ||
Ford, Mike wrote:
> On 04 August 2006 11:30, Dave M G wrote:
>
>> Jochem,
>>
...
>
> That's where capturing expressions and backreferences come in handy:
>
> preg_replace ("/.*<li>(.*)<br>.*/", "$1", $htmlPage);
>
> (add qualifiers and other options to taste, as before!)
ah yes, good point - you can do it with preg_replace() (I only mentioned
preg_match() (et al) - guess I left my regexp hat at home today. :-)
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Headingley Campus, LEEDS, LS6 3QS, United Kingdom
> Email: m.ford@leedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
>
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>