#!/usr/bin/perl
use strict;
use warnings;
my $string = "abcABC123ABCabc";
# the following is using shell commands
# to do something perl can do much better...
echo `expr match "$string" 'abc[A-Z]*.2'` ;
echo `expr match "$string" 'abc[A-Z]*2'` ;
####
#!/usr/bin/perl
use strict;
use warnings;
my $string = "abcABC123ABCabc";
print "Regex1: ", $string =~ /abc[A-Z]*.2/, "\n" ;
print "Regex2: ", $string =~ /abc[A-Z]*2/, "\n";
####
Regex1: 1
Regex2: