Hi ranchers, Iam new working with java regular expressions,I need reg-ex for accepting only alpha characters(A-Z a-z),and anything else should be thrown as error.
String Charmatch = "^[a-zA-Z]"; //dont know whether this is correct. if( !(lname.matches(Charmatch))){ ----- }//
The requirement is, a text box which should allow only characters,anything else should throw error. what I need is ,a regular expression which matches the requirement.
Remko Strating
Ranch Hand
Joined: Dec 28, 2006
Posts: 893
posted
0
Did you try the \d digit metacharacter like the code example
I have the same requirement and i tried the following code , but still Its givig me "Wrong input" , any suggestion is very much appreciable.Thanks In Advance.