This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
There are actually a lot of ways to parse out those numeric values.
An easy way is to get the value using the substring(int startpos,int endpos) method and then use Integer.parseInt(String value) method upon it. Be aware that a RuntimeException (NumberFormatException) is thrown by the parseInt method. If you do not catch it, it will throw an exception if the String does not hold a valid numeric value.