I have several strings in the rough form:
[some text] [some number] [some more text]
I want to extract the text in [some number] using the
In addition to Pattern, the Java String class also has several methods that can work with regular expressions, in your case the code will be:
"ab123abc".replaceFirst("\\D*(\\d*).*", "$1")
where \\D is a non-digit character.
\\D