How to match all alphabet except few?

前端 未结 1 1727
花落未央
花落未央 2021-01-04 21:57

I want to match [a-z] only except the letters a,e,i,o,u

Using negated set [^aeiou]* I could match everything except a,e,

相关标签:
1条回答
  • 2021-01-04 22:25

    You could use negative lookahead assertion. It's like a kind of subtraction.

    (?![aeiou])[a-z]
         ^        ^
         |        |
    subtract    from
    

    DEMO

    0 讨论(0)
提交回复
热议问题