How is the AND/OR operator represented as in Regular Expressions?

后端 未结 5 1876
独厮守ぢ
独厮守ぢ 2020-11-27 10:37

I\'m currently programming a vocabulary algorithm that checks if a user has typed in the word correctly. I have the following situation: The correct solution for the word wo

5条回答
  •  隐瞒了意图╮
    2020-11-27 10:58

    Not an expert in regex, but you can do ^((part1|part2)|(part1, part2))$. In words: "part 1 or part2 or both"

提交回复
热议问题