--On Sonntag, 18. November 2001 17:31 -0900 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Fri, Nov 16, 2001 at 10:39:57PM +0100, 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 $stri
#x27;s together.
Wags ;)
-Original Message-
From: Andrea Holstein [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 11:58
To: [EMAIL PROTECTED]
Subject: Re: capture strings with two non-identical capital letters in a
row
>
> my $string1 = "ABCD";
> m
On Fri, Nov 16, 2001 at 10:39:57PM +0100, 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.
The
>
> my $string1 = "ABCD";
> my $string2 = "AbCd";
> my $string3 = "AABcD";
>
> Get $string1, discard $string2 and $string2.
>
> ...
> but ABBC displays as valid!
>
> Wags ;)
What's the difference between "AABcD" and "ABBC" ?!
However, I wrote a little script with two different poss
Here is what I wrote for two non-identical...
@letters=split(//, $input);
for $a(0..$#letters)
{
if ($letters[$a] ne $letters[$a+1] && $letters[$a] =~ /[A-Z]/ &&
$letters[$a+1] =~ /[A-Z]/)
{
print $input;
last;
}
}
Agustin
- Original Message -
From:
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
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
Here is a shot using both regex and a for loop:
sub checker {
local $_ = $_[0]; # pass the data to be checked
return 0 if ( /[^A-Z]/ ); # if not capital letters, get out
my $MyResult = 1;
my @worka = split(//,$_); # split out all the ch