代码示例:(标识:python_regex_match_group)
python_regex_match_group.py
import re

str = "China is a great country"
x = re.search(r"\bC\w+", str)
print(x.group())
运行结果: