Re: RegEx Question
| From: | Gyozo Papp | Date: | Mon, 21 May 2001 10:34:44 +0000 |
| Subject: | Re: RegEx Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53689@lists.php.net to get a copy of this message | ||
if (preg_match_all("|testing(.*?);blah|s", $str, $matches))
{
// do what you want with $matches: see in the manual!
var_dump($matches);
}
----- Original Message -----
From: "George E. Papadakis" <georgep@phaistosnetworks.gr>
To: "PHP List" <php-general@lists.php.net>
Sent: 2001. május 20. 19:18
Subject: [PHP] RegEx Question
> Hi,
>
> I have an ereg question::.
> $data = a big string ,
> while (ereg ("testing([^;]*);blah(.*)",$data,$args)) {
> $this = $args[1];
> $data = $args[2];
> }
>
> What I wanna do ,obviously, is to get all the strings between 'testng' and
> 'blah' in an array.
> This will do it, yet when it wont work when special chars such \n exist
> between 'testing' and 'blah'.
> Any ideas?
>
>
>
> --
> 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
>