string split in Java

I have a form field's name as "myFamily[10].child[2]"How do i get 10 and 2 from that above string and assign to other variables. int row = 10;int col = 2;
[183 byte] By [Aiswarya22a] at [2007-11-27 1:11:46]
# 1
Regular expressions would probably be easiest.Look at the docs for the java.util.regex.* package.
paulcwa at 2007-7-11 23:47:06 > top of Java-index,Java Essentials,Java Programming...
# 2

String line = "myFamily[10].child[2]";

Pattern p = Pattern.compile("\\[(\\d+)\\][^\\[]*\\[(\\d+)\\]");

Matcher m = p.matcher(line);

if (m.find())

{

int row = Integer.parseInt(m.group(1));

int col = Integer.parseInt(m.group(2));

System.out.println(row + "\t" + col);

}

sabre150a at 2007-7-11 23:47:07 > top of Java-index,Java Essentials,Java Programming...