如何创建一个正则表达式,可以匹配多个单词中的任何一个?

huangapple 未分类评论42阅读模式
英文:

How would I create a regex that can match any of several words?

问题

就像我希望它在Word1、Word2或Word3上触发一样。

例如:
(Cleave|Flame|Punch|Fire Aspect|Knockback)

但那只匹配单个字母。

英文:

Like I want it to trigger on Word1, Word2, or Word3.

For example:
(Cleave|Flame|Punch|Fire Aspect|Knockback)

But that just matches individual letters.

huangapple
  • 本文由 发表于 2020年7月24日 04:07:01
  • 转载请务必保留本文链接:https://java.coder-hub.com/63062340.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定