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.
次の正規表現を考えてみましょう。XとYは任意の正規表現です。
X
Y
XY|YX|X|Y
Xこの正規表現はand/orをテストしますYが、「and」句が見つからない場合は式を再確認する必要があります。
X and/or を一致させる最良の方法は何Yですか?
X and/or Yこの正規表現についての要件については、次のとおりです。
X and/or Y
(?:(?=.*?X)|(?=.*?Y))(X|Y)