我想匹配包含强制字符和允许字符的整个单词。
例如
强制字符是:[c,a,t]
允许字符是:[y,s]
cat : passed (all mandatories are here)
caty : passed (all mandatories here and only allowed "y" char)
casy : failed (mandatory 't' is absent)
catso : failed (all mandatories but an intruder "o")
什么是合适的正则表达式代码?