import remobile = '18312423454'MOBILE = "^1[358]\d{9}$|^147\d{8}$|^179\d{8}$"p = re.compile(MOBILE)if p.match(mobile): print(mobile)