I am using the following code, to get the integers present in a string. But this will give the first occurrence of an integer. Just print 14. I need to get all the integers. Any suggestions.
Pattern intsOnly = Pattern.compile("\\d+");
Matcher makeMatch = intsOnly.matcher("hello14 hai22. I am here 4522");
makeMatch.find();
String inputInt = makeMatch.group();
1 Answer