我想知道是否有可能使用正则表达式检查字符串中是否存在一个或多个单词数组中的单词。这涉及到多个条目的异或运算...
字符串可以包含0个或1个以下的单词:
- Morning - Evening - Night
以下句子应该得到以下结果:
- This is a beautiful day => 匹配(0个单词) - How are you this Morning? => 匹配(1个单词) - This Morning, it was the Night! => 不匹配(1个单词) - This Night, we will have a wonderful Morning => 不匹配(2个或更多单词)
感谢您的帮助!
字符串可以包含0个或1个以下的单词:
- Morning - Evening - Night
以下句子应该得到以下结果:
- This is a beautiful day => 匹配(0个单词) - How are you this Morning? => 匹配(1个单词) - This Morning, it was the Night! => 不匹配(1个单词) - This Night, we will have a wonderful Morning => 不匹配(2个或更多单词)
感谢您的帮助!