On 18 Nov 2005 04:53:40 -0800, "jahhaj" <>
wrote, quoted or indirectly quoted someone who said :
>Unknown character category {Digit} near index 8
>\p{Digit}{1,2}
you did not post your code so I wrote this SSCCE
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* snippet ™ to demonstrate a problem with regex
*/
public class Regex4
{
private static final Pattern p =
Pattern.compile("(\\p{Digit}){1,2}");
/**
* test harness
*
* @param args not used
*/
public static void main ( String[] args )
{
// format 1
Matcher m = p.matcher("89");
m.matches();
int count = m.groupCount() + 1;
// display groups found
for ( int i=0; i<count; i++ )
{
System.out.println(m.group(i));
}
}
}
When I ran it on JDK 1.5.0_05
it gave the following results:
89
9
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.