the below will give me between _ and . for example Pet_you.txt
will give me you
but if I get pet_te_you.txt will get te_you but instead I need you result. how to fix my pattern to take last _?
Pattern MY_PATTERN = Pattern.compile("\\_(.*?)\\.");
Matcher m = MY_PATTERN.matcher("pet_te_you.txt");
while (m.find()) {
Type = m.group(1);
System.out.println(dbType);
}