On Thu, Dec 29, 2011 at 1:17 PM, Xi Chen <cxde...@gmail.com> wrote:
> Hello everyone,
>
> I have a question about how to translate the meaning of ".+?". Please
> see the examples below:
> SASI_Hs01_00205058      HUMAN   NM_005762       857     MISSION¬Æ siRNA 2     
>                    140.00
> I want to get number"857", I found the command below works:
> perl -ne 'if (/(SASI\w+)(.+?)\s(\d+)\s/) { print "$3\n"; }'
> but ".+" or ".*"doesn't work. I don't know why "?" is so important?
>

I believe it makes the grouping optional.

Match 1 or 0 times

HTH,

Chris

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to