On Mon, Feb 13, 2012 at 10:10 PM, Dr.Ruud <rvtol+use...@isolution.nl> wrote:
> On 2012-02-13 14:48, lina wrote:
>
>> $mystring3="abacadeusagaka35";
>>
>> if($mystring =~ m/(a.+)/g){
>>        print $1,"\n";
>> }
>>
>> Hi, I wonder how to print the "abacad" out?
>
>
> I assume you are looking for /((?:a.)+)/.


Thanks, how can I check the effect of using ?:

I don't understand this part, thanks again,

The perl match is magic.

>
>
> perl -Mstrict -wle '
>  my $s = shift;
>  print $1 while $s =~ /((?:a.)+)/g;
> ' abacadeusagaka35
> abacad
> agaka3
>
>
> perl -Mstrict -wle '
>  my $s = shift;
>  print for $s =~ /(?:a.)+/g;
> ' abacadeusagaka35
> abacad
> agaka3
>
> --
> Ruud
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>

--
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