You can make use of the ^
. It considers everything apart from what you have infront of it.
So if you have [^y]
its going to filter everything apart from y. In your case you would do something like
String value = string.replaceAll("[^0-9]","");
where string is a variable holding the actual text!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…