Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこの文字列を持っています -: @Harry @Harry are great twins with @Harry
@Harry @Harry are great twins with @Harry
@Harry上記の文字列で一致させたいと思います。しかし、ある条件で -:
@Harry
@Harry の前には何もないか、空白文字のみを付ける必要があります。連続する場合も同様です。
したがって、ここでは 3 つの一致が見つかる必要があります。現在、私はこれを行っていますが、無駄です -: (\s|^$)\@Harry(\s|^$)。
(\s|^$)\@Harry(\s|^$)