「Hello, call me XXX.」という文の部分文字列を見つける必要があります。文は非常に長くなる可能性があり、名前が何であるかを識別するのに役立つ唯一のことは、名前が常に fromat にあるという事実です"call me"+space+name"+dot
。それにもかかわらず、文は次のようにも見える可能性がありますhello, call me. call me xxx.
Call me John. ⇒ John
Call me Call me John. ⇒ prohibited - confusing
Call me. Call me John. ⇒ John
Call me Call me John. ⇒ John
Call me Peter .Call me John. ⇒ John
Call me Peter. Call me John. ⇒ prohibited - more then one name...
名前は、\r、\n、\0、およびドットを除く任意の文字列にすることができます。
誰かが正規表現を定義するのを手伝ってくれたら幸いです。私は2時間以上理解しようとしていますが、成功していません...