From 2d2f56894d29cf5dfa7d4dcdda2ff56131793aae Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Sun, 2 May 2021 22:18:42 +0800 Subject: edit ch-1.pl --- challenge-110/cheok-yin-fung/perl/ch-1.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/challenge-110/cheok-yin-fung/perl/ch-1.pl b/challenge-110/cheok-yin-fung/perl/ch-1.pl index a036df0b9f..e6340acc04 100644 --- a/challenge-110/cheok-yin-fung/perl/ch-1.pl +++ b/challenge-110/cheok-yin-fung/perl/ch-1.pl @@ -8,7 +8,9 @@ use warnings; my $s; while ($s = ) { chomp($s); - if (substr($s, -11) =~ / \d{10}/ && + if ( length $s == 15 && + substr($s, 4, 1) eq " " && + substr($s, -11) =~ / \d{10}/ && (substr($s,0,4) =~ /\d{4}/ || substr($s,0,4) =~ /\+\d{2}/ || substr($s,0,4) =~ /\(\d{2}\)/) -- cgit