reprasenting regular expression in XML

hai,

i have the following regular expression to reprasent 13digit number enclosed in a pair of brakets

String r= "\\([0-9]{13,}+\\)"

however when i reprasented in the XML tag as

<my>

<rs>\\([0-9]{13,}+\\)</rs>

</my>

and read using DOM parser,.unable to match the seqence is not matching at all.

will anybody pls. tell me howto reprasent in String r in XML

Thx

[450 byte] By [akbdasa] at [2007-10-2 21:35:12]
# 1

If the content in the XML file is

\\([0-9]{13,}+\\)

to represent this in a Java String, you need to code

String target = "\\\\([0-9]{13,}+\\\\)";

The backslash (\) is an escape prefix in Java. So to get a single backslash, you need to specify 2 of them. Since you want two backslashes in the string, you need to specify 4 of them.

Dave Patterson

d.pattersona at 2007-7-14 0:49:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
And conversely, if your Java code saysString r = "\\([0-9]{13,}+\\)";then the actual value of the string is\([0-9]{13,}+\)and that's what you should put in your XML.
DrClapa at 2007-7-14 0:49:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...