Sha256: 234b1a820ab435b1ab84094e1288a0b15a48e846a6df5b55498629d867c0aa38

Contents?: true

Size: 392 Bytes

Versions: 114

Compression:

Stored size: 392 Bytes

Contents

exercise: PhoneNumber
version: 2
plan: 15
subs: clean_number
tests: |-
  foreach my $subcases (@{$C_DATA->{cases}}) {
    is $subs{clean_number}->($_->{phrase}), $_->{expected}, $_->{description} foreach @{$subcases->{cases}};
  }

example: |
  sub clean_number {
    my ($number) = @_;
    $number =~ s/\D//g;
    return $number =~ /^ 1? ( (?: [2-9] \d{2} ){2} \d{4} ) $/x ? $1 : undef;
  }

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
trackler-2.2.1.110 tracks/perl5/exercises/phone-number/.meta/exercise-data.yaml
trackler-2.2.1.109 tracks/perl5/exercises/phone-number/.meta/exercise-data.yaml
trackler-2.2.1.108 tracks/perl5/exercises/phone-number/.meta/exercise-data.yaml
trackler-2.2.1.107 tracks/perl5/exercises/phone-number/.meta/exercise-data.yaml
trackler-2.2.1.106 tracks/perl5/exercises/phone-number/.meta/exercise-data.yaml
trackler-2.2.1.105 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.104 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.103 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.102 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.101 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.100 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.99 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.98 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.97 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.96 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.95 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.94 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.93 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.92 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.91 tracks/perl5/exercises/phone-number/example.yaml