import re string = '<h4 class="title">愤怒的葡萄</h4>' pattern = '<h4 class="title">(.*?)</h4>' # pattern = '.*?s' s = re.compile(pattern).findall(string) print(s)