Re: Regexp

From: Date: Tue, 29 Aug 2000 13:21:53 +0000
Subject: Re: Regexp
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-14113@lists.php.net to get a copy of this message
At 14:36 29-8-00 +0200, MEGRET Arnaud wrote:
Hi I have a var looking like : XXXXXXXAZEYYYYYYYYYYYYYYYYYYPOIXXXXXXXXXXX where : XXXX doesn't contain the strings AZE or POI YYYY can contain those strings 1 ore more time. I would like to use ereg to get three var containing : XXXXXXXXXXXX AZEYYYYYYYYYYYYYYYYPOI XXXXXXXXXXX
if (Preg_Match("').*?)(AZEY.*?POI)(.*?)'", "XXXXXXXAZEYYYYYYYYYYYYYYYYYYPOIXXXXXXXXXXX", $matches)) {
        var_dump($matches);
} P.S. use: if (Preg_Match("').*?)(AZEY.*?POI)(.*?)'i", ... for case insensitive Greetz, Wico
In other words, I would like to get from the first occurence of the string AZE to the last occurence of POI. Is it possible with one regexp expression? thanks ____________________________________________ Arnaud Megret (arnaud.megret@cegetel.fr) Cegetel ____________________________________________ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#14113) next »