Front page | perl.beginners |
Postings from March 2012
Re: how to extract one block out
Thread Previous
From:
timothy adigun
Date:
March 14, 2012 01:50
Subject:
Re: how to extract one block out
Message ID:
CAEWzkh7aB1j9ct4-iB==8c-FY4pkZ-46CQTCwu6J5XxJCHKgrA@mail.gmail.com
Hi lina,
Please check my suggestion below
On Wed, Mar 14, 2012 at 7:00 AM, lina <lina.lastname@gmail.com> wrote:
> Hi,
>
> Here I have
>
> ...some blocks ...
>
> @article{Bi07_chen,
> author = {Chen, J. P. and Zhang, X. and Fernandez, A.},
> journal = BIOINFOR,
> volume = {23},
> number = {5},
> pages = {563-572},
> year = {2007}
> }
>
> @article{MP08_Crespo,
> author = {Crespo, A. and Fernandez, A.},
> journal = MOLPHARM,
> volume = {5},
> number = {3},
> pages = {430-437},
> year = {2008}
> }
>
> I only wanted to extract this bolck out
>
>
> @article{Bi07_chen,
> author = {Chen, J. P. and Zhang, X. and Fernandez, A.},
> journal = BIOINFOR,
> volume = {23},
> number = {5},
> pages = {563-572},
> year = {2007}
> }
>
> using
>
> if ($line =~ /Bi07\_chen/..$line =~ /^\}$/){
> print $line;
> }
>
> use:
if($line=~/.+?_chen/..$line=~/\}(?=\n)/){
print $line;
}
> but it expanded to the final }
>
> Thanks ahead for your suggestions,
>
> Best regards,
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
--
Tim
Thread Previous