
Python
- 27 ответов
- 0 вопросов
27
Вклад в тег
sting.replaceAll("\\D+", "");
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Main {
public static void main(String[] args) {
String string = "[апваварпвава, авпварпваавр, варварвра54%]";
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(string);
while(matcher.find()) {
System.out.println(matcher.group(0));
}
}
}