[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] List with only 1 item



Did you forget g?

 @myMatches =  ($myString =~ /(a.*?t)/g);

This seems to work.

---------------------------------
Joe Erickson
Crazy Person

on 5/28/00 8:43 AM, Bert Altenburg at bsfa@knoware.nl wrote:

> 
> Hi,
> 
> Why does the MacPerl script below
> 
> $myString = 'Julia is a beautiful actress';
> @myMatches =  ($myString =~ /(a.*?t)/);
> print "@myMatches";
> 
> result in a list with only one item ('a is a beaut')? I'd expect more
> (for example 'act' from actress, and possibly 'aut' and 'a beaut' as
> well).
> 
> If I do the print with $1, $2 etc. I only get $1.
> 
> Bye for now,
> 
> Bert
> 
> # ===== Want to unsubscribe from this list?
> # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
> 


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org