i am trying to extract "d320" from the below string using regex in java using the below code n-us; micromax d320 build/kot49h)
String m = "n-us; micromax d320 build/kot49h) ";
String pattern = "micromax (.*)(\\d\\D)(.*) ";
Pattern r = Pattern.compile(pattern);
Matcher m1 = r.matcher(m);
if (m1.find()) {
System.out.println(m1.group(1));
}
but it is giving me the output as "d320 build/kot4" , i want only d320