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.
定義済みの部分文字列が 2 つ以上一致しないことに基づいてテキスト フィールドをフィルタリングする方法を考えています。たとえば、文字列に 2 つ以上の部分文字列への一致が含まれている場合は、それを拒否します。
でもやってみたら
(tion|exal|ta|iest|ent){,2}
次に、'exalt' や 'cow' のようなものには一致しないようですが、'exaltation' ではなくこれらに一致するはずです。大文字と小文字は重要ではありません。
これは、拒否する文字列と一致します(一致しない文字列とは一致しません)。
.*((tion|exal|ta|iest|ent).*){3}
それはJavaとRubyで私のために働いた。結果は異なる場合があります。