in reply to regexp to match repeated charater
Good Luck ^^#!/usr/bin/perl my $string = 'It was an intelligent stori'; my $matches = 0; my (@chr) = split(//, $string); foreach (@chr) { $matches++ if ($_ =~ m/[iI]/); # match it & count } print "Content-type: text/html\n\n"; print "<html>String: $string<hr>Matches: $matches</html>\n";
|
|---|