Thanks for the suggestion but it's still not working. There's got to be a way to do this without looping through a charachter at a time.
On Wed, Jan 14, 2009 at 7:03 AM, Dan Dumont <[email protected]> wrote: > Sorry, that's "Match 1 character *NOT *a-z, followed by any character zero > or more times." > > try "^[^a-z]+$" > > > > On Wed, Jan 14, 2009 at 10:00 AM, Dan Dumont <[email protected]> wrote: > >> It is checking the entire length of the string... your pattern is not >> doing what you want. >> >> I suggest you read up on regular expressions. Your regexp says: >> Match 1 character a-z, followed by any character zero or more times. >> >> >> >> On Wed, Jan 14, 2009 at 2:28 AM, Josh <[email protected]> wrote: >> >>> >>> i have the following code in place to ensure that the user only enters >>> the letters a through z into the EditText control. >>> >>> if (Pattern.matches("[^a-z].*", DrawingName.getText().toString())) { >>> //do nothing for now >>> DrawingName.setText("WRONG"); >>> } >>> >>> The problem is it only checks the first character. How can I make it >>> check the entire length of the string? } >>> >>> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

