- or download this
my $s = 'hello world! how are you? whoops, forgot.';
my @no_caps = $s =~ /[.?!]\s*((?![A-Z])[a-z]\w+)/g;
- or download this
$s =~ s/^((?![A-Z])[a-z]\w+)/ucfirst$1/e;
$s =~ s/([.?!]\s*)((?![A-Z])[a-z]\w+)/$1.ucfirst$2/eg;
- or download this
use strict;
...
print "$2 is not capitalized\n";
}
}
- or download this
my $file = do {local $/; <>};
...
while ($file =~ /([.?!]\s*)((?![A-Z])[a-z]\w+)/g) {
print "$2 is not capitalized\n";
}