uat-prx02:/root# cat a1.pl
my $str="123";
if ($str =~/(abc)*/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
111111111
匹配 0 次或多次 abc 字符串
uat-prx02:/root# cat a1.pl
my $str="abc";
if ($str =~/(abc)+/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
111111111
uat-prx02:/root# cat a1.pl
my $str="abcabc";
if ($str =~/(abc)+/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
111111111
+: 一个或多个相同的前导字符(模式)
uat-prx02:/root# cat a1.pl
my $str="abcabc";
if ($str =~/(abc){2}/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
111111111
uat-prx02:/root# cat a1.pl
my $str="abcc";
if ($str =~/(abc){2}/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
uat-prx02:/root# ^C
uat-prx02:/root# ^C
匹配不上
uat-prx02:/root# cat a1.pl
my $str="abcc";
if ($str =~/abc{2}/){print "111111111\n"};
uat-prx02:/root# perl a1.pl
111111111