图片发自简书App
#coding=utf-8
#3.匹配一行文字中的所有开头的数字内容或字母内容
import re
s = "123sdf"
content = re.match(r"\w+",s).group()
print(content)
用时12分钟。
需要了解group方法。
#coding=utf-8
#3.匹配一行文字中的所有开头的数字内容或字母内容
import re
s = "123sdf"
content = re.match(r"\w+",s).group()
print(content)
用时12分钟。
需要了解group方法。