Suppose I have this java string. Note there are two <c></c>
pairs one contains only numbers but the other one contains numbers and a string.
How do I know if a string contains <c></c>
with only numbers in Java?
I did this but it didn't work.
String keyPattern = "^<id>[0-9]</id>$";
boolean hasKey = str.matches(keyPattern);
<start><a></a><b></b><c>addf123</c><d><d><c>1234</c><foo></foo><bar></bar></start>