Reputation: 89
I how to create regex to not to accept only special character or number. for eg:
it should throw error if string contain :
but should not throw error if string contain :
Upvotes: 1
Views: 99
Reputation: 16436
Simply use regex which allow alpha bates
compulsory
/.*[a-z]+.*/i
Upvotes: 2
Reputation: 2025
Try this regex and let me know. It is also accept white space:
/^[ A-Za-z0-9_@./#&+-]*$/
Upvotes: 0