题解 | #截断电话号码#
截断电话号码
https://www.nowcoder.com/practice/078d1abcb55648f687a78d87e4b3cb69
import re phone_text = input() pattern = "[0-9|-]*" result = re.match(pattern, phone_text) print(result.group())
截断电话号码
https://www.nowcoder.com/practice/078d1abcb55648f687a78d87e4b3cb69
import re phone_text = input() pattern = "[0-9|-]*" result = re.match(pattern, phone_text) print(result.group())
相关推荐