Question: I am trying to parse the certain name from the filename.

The examples of File names are 

```
xs_1234323_00_32

sf_12345233_99_12

fs_01923122_12_12

```

I used `String parsedname= child.getName().substring(4.9)` to get the 1234323 out of the first line. Instead, how do I format it for the above 3 to output only the middle numbers(between the two \_)? Something using `split`?

Answer: 
one line solution

```
String n = str.replaceAll("\\D+(\\d+).+", "$1");

```

most efficent solution

```
    int i  = str.indexOf('_');
    int j = str.indexOf('_', i + 1);
    String n = str.substring(i + 1, j);

```
You can try using split using the '\_' delimiter.