Reputation: 1292
I have a optional fields in which I have to accept only single character and I should also accept empty string. Ex: if I have a middle name field, in which it accepts single char. but in future if he don't want any middle name on his account then I should persist empty to the middle name in the database.
I used the below regexp. but it is not working to accept empty string
[^$]|[A-Za-z]+
Could some one help me on this?
Upvotes: 0
Views: 1965