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.
正規表現ジェネレーターを使用して式を作成しようとしていますが、正しく取得できないようです。
私がする必要があるのは、文字列で次のタイプの文字列を見つけることです:
community_n
たとえば、
community community_1 community_new_1 community_1_new
そこから、抽出したいだけですcommunity_1
community_1
を試してみ/(community_\\d+)/ましたが、明らかに正しくありません。
/(community_\\d+)/
単語境界を追加してみてください。
/(\\bcommunity_\\d+\\b)/
正規表現(community_ \ d +)を使用してみてください。使用している言語がわからないので間違っているかもしれませんが。(何らかの理由でコメントを追加できず、質問にしか答えられません)。