regex - Extract numbers from a string in java -


i want extract numbers string like:

str="good_mor9ni13ng_23guys "; 

the output should array [9,13,23]. how should proceed?

you this:

list<string> matches = new arraylist<string>(); matcher m = pattern.compile("[0-9]+").matcher("good_mor9ni13ng_23guys"); while (m.find()) {     matches.add(m.group()); } 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -