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 valid, return 'In with a chance'.

If 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!

Source: codewars | Difficulty: EASY
Tags: String algorithms

Starter code: def validate_number(s):
	

Solutions:
import re
yes = 'In with a chance'
no = 'Plenty more fish in the sea'

def validate_number(string):
	return yes if re.match('^(\\+44|0)7[\\d]{9}$', re.sub('-', '', string)) else no


import re

def validate_number(string):
	if re.match('^(0|\\+44)7[0-9]{9}$', string.replace('-', '')):
		return 'In with a chance'
	else:
		return 'Plenty more fish in the sea'


import re

def validate_number(string):
	return 'In with a chance' if re.match('^(07|\\+447)\\d{9}$', string.replace('-', '')) else 'Plenty more fish in the sea'


from re import match
validate_number = lambda s: ['Plenty more fish in the sea', 'In with a chance'][match('^(\\+44|0)7\\d{9}$', s.replace('-', '')) != None]


import re
VALID_NUM = re.compile('(\\+44|0)7\\d{9}$')

def validate_number(s):
	return 'In with a chance' if VALID_NUM.match(s.replace('-', '')) else 'Plenty more fish in the sea'


import re

def validate_number(s):
	if not s:
		return 'Plenty more fish in the sea'
	regex = '(?:-*)(0|\\+44)(7)((?:\\d-*){9})(?:-*)$'
	mo = re.match(regex, s)
	if mo:
		return 'In with a chance'
	else:
		return 'Plenty more fish in the sea'


def validate_number(s):
	s = s.replace('+44', '0', 1).replace('-', '')
	return 'In with a chance' if s[:2] == '07' and len(s) == 11 and s.isdigit() else 'Plenty more fish in the sea'


validate_number = lambda s: ['Plenty more fish in the sea', 'In with a chance'][bool(__import__('re').fullmatch('(0|\\+44)7\\d{9}', s.replace('-', '')))]