I’m comming with a little question here. I need to do something to validate the a name in the registration form, until now I did this :
if(TextUtils.isEmpty(textFullName) )
and this
else if(!textFullName.matches("[a-zA-Z ]+"))
but those are for empty and alphabetic characters, the problem is that I can’t have spaces between names like : " Bill Bob" ( it works only if they are together : "BillBob" ) and another thing is that I want this symbol : "-" , because some names have it, like : "Bill-Bob".
Thank you for helping me out!
2
Answers
The regex should also include
space(\s)
and-
asdf asfdsafv sdfasdfasdfasdf sadlf kasfkdl asdfh hasfoiasf ,asdij fl i;adsfjo f s dasd