Using regex to match any character except =

前端 未结 4 1908
离开以前
离开以前 2021-01-07 17:13

I am trying to write a String validation to match any character (regular, digit and special) except =.

Here is what I have written -

    String patt         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 17:23

    If the only prohibited character is the equals sign, something like [^=]* should work.

    [^...] is a negated character class; it matches a single character which is any character except one from the list between the square brackets. * repeats the expression zero or more times.

提交回复
热议问题