import re def extract_phone_number(string_to_be_checked): search = re.search("(0?61\\s\\d.\\d{3}.\\d{3})", string_to_be_checked) if search is None: return '' else: return search.group()