アルファベット以外の文字が前後にあるテキスト内の文または単一の単語を検索するための一般的な指示が必要です。必要なものを説明するためにいくつかの例を挙げます。
「幸運」を検索:
good luck in the exam.. (should match the pattern)
hello! good luck in the exam.. (should match)
mm,good luck! .. (should match)
hello again i wish yougood luckin the exam. (**should Not match**)
つまり、正規表現は、英字に含まれていない場合に文と一致する必要があります。