Try this if you want regex. This may not be the appropriate but works. @list = ('1992','1993 (summer)','1995 fall'); foreach (@list) {
push @array, $1 if $_ =~ /(\d+)\s*.*$/; } print map {$_,"\n"} @array; regards Rajendran Burlingame,CA ----- Original Message ----- From: "Shaun Bramley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 25, 2002 1:24 PM Subject: Help with regular expression > Hi all, > > I'm just looking for some confirmation on my regx. > > I have a list ('1992', '1993 (summer)', '1995 fall') and what I want to do > is keep only the first four characters. Will the regx work for me? > > @list =~ s/\s*//; > > Again will that turn the list into (1992, 1993, 1995)? > > > as always thank you for your time and effort in helping me > > Shaun Bramley > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]