Re: Regular expressions
| From: | Curt Zirzow | Date: | Fri, 24 Oct 2003 13:44:02 +0000 |
| Subject: | Re: Regular expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167421@lists.php.net to get a copy of this message | ||
* Thus wrote Fernando Melo (fernando.m@envent.co.za):
> Hi all,
>
> I have the following statement:
>
> $text = ereg_replace
> ("[live/]*content\.php\?[&]*Item_ID=([0-9]*)&Start=([0-9]*)&Category_ID=([0-
> 9]*)[&]*", "content\\1start\\2CID\\3.php", $text);
>
> Basically what I'm trying to do is if the URL includes "live/" then I want
> to include it in the replace. The way I have it now check for all the
> letters in "live" instead of the whole string.
>
> I hope I explained this properly.
I dont really quite follow what you want to do, your regex would
replace something like:
lcontent.php?&Item_ID=34&Start=54&Category_ID=98&
to
content34start54CID98.php
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/