|
Posted by mark babli on 08/22/06 19:06
"Sandman" <mr@sandman.net> wrote in message
news:mr-80F777.20130122082006@individual.net...
> In article <WNGGg.17010$o27.12331@newssvr21.news.prodigy.com>,
> "mark babli" <mbabli@photozig.com> wrote:
>
>> Hello,
>>
>> if I extracted a string from a file ( ="test"; )
>> How can I extract the word test from here. Sorry if this is not related
>> to
>> php (rather regular expression) but, I'll appreciate any help.
>
> That's too general of a question. Do you want to extract alpha
> character found within the quotes, or can it look differently? To
> answer your question:
>
>
> #!/usr/bin/php
> <?
> $string = '( ="test"; )';
> preg_match("/\( =\"(\w+)\"; \)/", $string, $m);
> print $m[1];
> ?>
>
> Output: test
>
> --
> Sandman[.net]
Actually, I need what is between the " ". Thanks
[Back to original message]
|