As far as i remember "d" means digit, but not digits ... try to add + or *.
2006/5/10, temp temp <[EMAIL PROTECTED]>:
Note: forwarded message attached. ------------------------------ Blab-away for as little as 1¢/min. Make PC-to-Phone Calls<http://us.rd.yahoo.com/mail_us/taglines/postman2/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com>using Yahoo! Messenger with Voice. ---------- Wiadomość oryginalna ---------- From: temp temp <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Wed, 10 May 2006 09:08:49 -0700 (PDT) Subject: [java.util.regex ]using Regular Expressions I am having problems with Regular Expressions usage. I want to ensure that the user enters only digits and no other characters. For this I am using the code below. I create a Pattern Object to which I pass a regular expression and when I call matches method I always get false. What am I doing wrong? Pattern p=Pattern.compile("\\d"); System.out.println(p.matcher("456").matches()); Thanks & Regards ------------------------------ How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates. <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]