我有一个模式。
我希望搜索
我正在寻找一个正则表达式模式。
pattern = "hello"
和一个字符串
str = "good morning! hello helloworld"
我希望搜索
str
中的 pattern
,使得整个字符串作为一个单词存在,即不能在 helloworld
中返回子字符串hello
。如果 str
不包含 hello
,则应返回 False。我正在寻找一个正则表达式模式。