I am having an String like this
"ATS0657882\nPRX1686559\n name: something,hello"
Now i want to do is only get the "ATS0657882","PRX1686559", and so on,
How can i do this, i used lot of ways but i cant find the solution.
I am having an String like this
"ATS0657882\nPRX1686559\n name: something,hello"
Now i want to do is only get the "ATS0657882","PRX1686559", and so on,
How can i do this, i used lot of ways but i cant find the solution.
Try this
String example = "ATS0657882\nPRX1686559\n name: something,hello";
Pattern p = Pattern.compile("[A-Z]{3}[0-9]{7}"); // or [A-Z]{3}\\d{7}
Matcher m = p.matcher(example);
while (m.find()) {
Log.i("Findings", "values are " + m.group());
}