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

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