Patrick Hall wrote at Wed, 05 Jun 2002 11:01:31 +0200: > Hi, > > I'd like to push all sequences of capitalized words onto an array. > > So, given this paragraph (which I just snagged off AP) > Indian Prime Minister Atal Bihari Vajpayee said > Wednesday that India would consider jointly monitoring the disputed Kashmir border >with its > longtime rival Pakistan. > > would return: > > Indian Prime Minister Atal Bihari Vajpayee > Wednesday > India > Kashmir > Pakistan >
my $cap_word = qr/\b[[:upper:]]\w*\b/; my @sequences = $text =~ m/($cap_word(?:\s+$cap_word)*)/gs; Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]