#!/usr/bin/perl
use strict;
my (@arrayofstrings) = ('Newbie', 'NNewbie', 'NNNNNewbie', 'ewbie');
foreach my $string (@arrayofstrings) {
print "$string -- ";
if ($string =~ /N*ewbie/) {
print " match found.\n";
} else {
print " no match.\n";
}
}
exit;
Results:
Newbie -- match found.
NNewbie -- match found.
NNNNNewbie -- match found.
ewbie -- match found.
|