regex check for white space in middle of string

前端 未结 5 1974
感情败类
感情败类 2020-12-16 14:08

I want to validate that the characters are alpha numeric:

Regex aNum = Regex(\"[a-z][A-Z][0-9]\");

I want to add the option that there migh

5条回答
  •  情书的邮戳
    2020-12-16 15:04

    Exactly two words with single space:

    Regex aNum = Regex("[a-zA-Z0-9]+[\s][a-zA-Z0-9]+");
    

    OR any number of words having any number of spaces:

    Regex aNum = Regex("[a-zA-Z0-9\s]");
    

提交回复
热议问题