Regex validation Allow only Character and space in Asp.net

asp.net, regex, validation

Solution

Try this:

([A-Za-z])+( [A-Za-z]+)*
                       ^^ here

`*` means to repeat the group zero or more times. If you need it to be one or more times, then use `+`. Another thing you can use `[ ]+` instead of space to handle one or more consecutive spaces.

Also, if you need, you can use anchor `^` and `$` around your regex. Like `^...regex...$`

Problem

hello every one i need a validation that can only validate to character and white space.. no mater how much space and character in text-box i use this regexp validation below. but its only allow one space between two words but don`t allow the third space for third word. ([A-Za-z])+( [A-Za-z]+) how to allow only characters and spaces in Regexp Validation?

Original source