标签:
Python的正则表达式模块
1 # -*- coding:utf-8 -*- 2 3 import re 4 text = "JGood is a handsome boy, he is cool, clever, and so on..." 5 m = re.match(r"(\w+)\s", text) 6 if m: 7 print m.group(0), ‘\n‘, m.group(1) 8 else: 9 print ‘not match‘
标签:
原文地址:http://www.cnblogs.com/IDomyself/p/4797726.html