> Thanks. This is the first regexp I`ve used. It turns out my
>problem was using "^\p" instead of the correct "\P".
for other regex hints, see http://mindprod.com/jgloss/regex.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
> Thanks. This is the first regexp I`ve used. It turns out my
> problem was using "^\p" instead of the correct "\P".
You could also have used ^ just inside [].
Try running:
import java.util.regex.Pattern;
public class R {
public static void main(String[] args) {
System.out.println(Pattern.matches("\\p{Digit}+", "123"));
System.out.println(Pattern.matches("\\p{Digit}+", "ABC"));
System.out.println(Pattern.matches("\\P{Digit}+", "123"));
System.out.println(Pattern.matches("\\P{Digit}+", "ABC"));
System.out.println(Pattern.matches("[^\\p{Digit}]+", "123"));
System.out.println(Pattern.matches("[^\\p{Digit}]+", "ABC"));
}
}
Arne