且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

正则表达式验证仅允许Asp.net中的字符和空格

更新时间:2022-11-14 19:50:30

试试这个:

 ^ [a-zA-Z] +(\s + [a-zA-Z] +)* 



hello every one i need a validation that can only validate to character and white space.. no mater how much space and character in textbox

i use this regex validation below. but it`s only allow one space between two words but don`t allow the third space for third word

([A-Za-z])+( [A-Za-z]+)

Try this:
^[a-zA-Z]+(\s+[a-zA-Z]+)*