Click here to Skip to main content
15,887,249 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a text box that I need to validate so that only alphanumeric values and spaces can be entered. Can anyone please tell me what exact regular expression I should use?
Posted
Updated 26-Apr-11 0:20am
v2
Comments
LittleYellowBird 26-Apr-11 6:21am    
Hi, I noticed your title was all capitals and this looks very demanding, as though you are shouting, and therefore aggravates other users of the forum. Therefore, I have corrected it for you (and a few spelling problems in your question). Cheers, Ali :)

try Those Links

Click[^]

ClickHere[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Apr-11 16:33pm    
It answers the question, a 5.
--SA
Try:
"^[0-9a-zA-Z ]+$" 


(there is a space in the square bracket as one of the options.)


Look here for more variations: Similar discussion[^]

try!
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 26-Apr-11 16:32pm    
As simple as that, my 5.
--SA
Sandeep Mewara 27-Apr-11 0:21am    
Yep! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900