but ABBC displays as valid! Wags ;)
-----Original Message----- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 14:56 To: [EMAIL PROTECTED] Subject: Re: capture strings with two non-identical capital letters in a row Birgit Kellner wrote: > > How can I filter out strings which contain two (or three) non-identical > capital letters in a row? > > my $string1 = "ABCD"; > my $string2 = "AbCd"; > my $string3 = "AABcD"; > > Get $string1, discard $string2 and $string2. This will work on the data provided: while ( <DATA> ) { print if !/[[:lower:]]/ and /(.)(?!\1)/g; } __DATA__ ABCD AbCd AABcD John -- use Perl; program fulfillment -- 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]