On Feb 8, 2:31 pm, "u...@yahoo.com" <u...@yahoo.com> wrote:
> On Feb 7, 7:30 pm, John <printdude1...@gmail.com> wrote:
>
>
>
>
>
> > u...@yahoo.com wrote:
> > > I want to detect whether the java String has any non-numeric and non-
> > > whitespace char. For example,
> > > "12 34" returns false
> > > "1234" returns false
> > > "12a3" returns true
> > > " a 12 3" returns true
>
> > > Can I use [^0-9\\s]? If not, what does it mean?
>
> > Here, try looking for something in the methods of the String class
>
> >http://java.sun.com/j2se/1.5.0/docs/...ng/String.html
>
> > I'm thinking you should be able to use the "matches" method to do what
> > you want if you can figure out the regular expression business.
>
> Thanks for the reply. The regular expression business is the thing
> that I am asking for help.
- Hide quoted text -
>
> - Show quoted text -
So basically you want to know if there are any alpha characters in the
string. So, why not just use ([a-zA-Z]) in the regex expression?