Is that a real phone number? (British version)
Description:
Congratulations! That Special Someone has given you their phone number.
But WAIT, is it a valid number?
Your task is to write a function that verifies whether a given string contains a valid British mobile (cell) phone number or not.
If the string is a valid UK number, return
"In with a chance"
.If it is invalid, or if you're given an empty string, return
"Plenty more fish in the sea"
.
A number can be valid in the following ways:
Here in the UK, mobile numbers begin with
"07"
followed by 9 other digits, e.g."07454876120"
.Sometimes the number is preceded by the country code, the prefix
"+44"
, which replaces the"0"
in‘07’
, e.g."+447454876120"
.And sometimes you will find numbers with dashes in-between digits or on either side, e.g.
"+44--745---487-6120"
or"-074-54-87-61-20-"
. As you can see, dashes may be consecutive.
Good Luck Romeo/Juliette!
Similar Kata:
Stats:
Created | Nov 2, 2016 |
Published | Nov 2, 2016 |
Warriors Trained | 2251 |
Total Skips | 29 |
Total Code Submissions | 7414 |
Total Times Completed | 1383 |
JavaScript Completions | 686 |
PHP Completions | 128 |
CoffeeScript Completions | 13 |
Crystal Completions | 11 |
Python Completions | 527 |
Ruby Completions | 92 |
Total Stars | 31 |
% of votes with a positive feedback rating | 92% of 315 |
Total "Very Satisfied" Votes | 267 |
Total "Somewhat Satisfied" Votes | 43 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |