RegexCheatSheet.pm: Removing are_same_case - already handled by are_valid_char_classes

master
Rob Emery 2013-11-14 18:29:08 +00:00
parent 3e6e76243c
commit d5765807c0
1 changed files with 1 additions and 8 deletions

View File

@ -151,13 +151,6 @@ our %syntax_map = (
'$&' => 'Entire matched string',
);
sub are_same_case($$) {
my ($a, $b) = @_;
my $both_uc = $a eq uc($a) && $b eq uc($b);
my $both_lc = $a eq lc($a) && $b eq lc($b);
return ($both_uc || $both_lc);
}
sub are_valid_char_classes($$) {
my ($a, $b) = @_;
# must be both numbers or both lowercase or both uppercase
@ -180,7 +173,7 @@ handle remainder => sub {
# Let the user provide [a-e], [1-2], nice simple examples only!
if ($_ =~ /\[([a-zA-Z0-9])\-([a-zA-Z0-9])\]/) {
return unless are_same_case($1, $2) && are_valid_char_classes($1, $2);
return unless are_valid_char_classes($1, $2);
#if there are < 3 between them then output all between them, otherwise "0 or 1 .. or 9" style
my $range_string = "";
if (difference_between($1, $2) < 3) {