RE: [PHP] Calling Regular Expression experts!
| From: | Jonas Bonde | Date: | Mon, 24 Jul 2000 00:38:01 +0000 |
| Subject: | RE: [PHP] Calling Regular Expression experts! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7797@lists.php.net to get a copy of this message | ||
Thanks for your fast answer..
>> I got a string like this $urldata = .."- SamsungYEPP1.995:- 2.500:-
>> DiamondRIO 5002.990:- - SonyMemorysti...3.990:- 4.000:- I "..
>> What I want to do is to get the "1.995" value into a new
>> string. The problem
>> is that the 1.995, could look something like this : 1 995
>> 1985 2.995 1,935
>> . How Do I write a regular expresion for that?
>
>This seems to work quite nicely:
>
>preg_match_all('/([0-9]+[,. ]?[0-9]+)/', $urldata, $matches);
>
>for($i=0; $i<count($matches[0]); $i++){
> echo $matches[0][$i]."<BR>\r\n";
>}
Oki, But If I want the value behind "SamsungYEPP" what should i Do then?
//Jonas