Hi,
Can anyone help me to find regular expression for the following in Perl?
"The string can only contain lower case letters (a-z) and no more than one of any letter."
For example: "table" is accepted, whether "dude" is not.
I have coded like this:
$str = "table";
if ($str =~ m/\b([a-z])[^\1]\b/) {
...
}
But it does not work . Any helps would be appreciated. Thanks.
Off my Windows MSDev compiler, I redirect each project to some log files. Because of that, I would like to get the begining word of the mached string line into a variable.
so,
my $error = ' - 0 error(s)';
chomp(my $log_file = "D:\\$proj_$log_dir\\$log_file"));
my @in_log_file = open(IN, "<$log_file");
foreach $_(@in_log_file) {
if ($_ eq $error) {
print "No errors found\n";
} else {
.....
here is where I want the "Libtool" into a variable....
}
}