I want to allow a user to enter only characters and with single space in a textbox. What i have tried is :
^[\w\.:\(\)\[\]{}\-_](?: ?[\w\.:\(\)\[\]{}\-_])*$
it is blocking all but allowing digits also . How to make it correct such that it only allow characters and no digits but a single space between words? Thank you.
I'd use:
^[\p{L}.:()[\]{}_-]+(?: [\p{L}.:()[\]{}_-]+)*$
Where \p{L}
stands for any letter.
Edit:
I've changed \pL
to \p{L}
because it's not supported by .NET
.
Thanks to Alan Moore.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments