尝试使用re.search运行代码时,我收到以下错误:AttributeError:module're'没有属性'search'。
#!/opt/anaconda3/bin/python3
import re
if __name__ == "__main__":
list_of_strings = ["This is string 1",
"This is another string",
"Most material here",
"Let's give it enough to be interesting",
"1 last strings"
]
print ("\nSearch")
for x in list_of_strings:
find = re.search("string(.)", x)
if find:
print (x)