Regex to validate string for having three non white-space characters

前端 未结 2 1937
旧时难觅i
旧时难觅i 2021-01-26 17:45

I am using parsley js for validating input and I am using the data-parsley-pattern which allows me to pass in regular expression.

I am trying to validate the string to m

2条回答
  •  故里飘歌
    2021-01-26 18:43

    "[^\s][^\s][^\s]+"
    [] contains a character class.
    /s is a whitespace character.
    ^ works kind of like a logical not.
    The + catches one or more of the previous character
    You may need to add more backslashes depending on any special escape characters

提交回复
热议问题