package kr.syeyoung.dungeonsguide.utils; import java.text.DecimalFormat; import java.util.regex.Pattern; public class TextUtils { private static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)ยง[0-9A-FK-OR]"); private static final Pattern SCOREBOARD_CHARACTERS = Pattern.compile("[^a-z A-Z:0-9/'.]"); private static final Pattern INTEGER_CHARACTERS = Pattern.compile("[^0-9]"); public static String stripColor(String input) { return STRIP_COLOR_PATTERN.matcher(input).replaceAll(""); } public static String keepScoreboardCharacters(String text) { return SCOREBOARD_CHARACTERS.matcher(text).replaceAll(""); } public static String keepIntegerCharactersOnly(String text) { return INTEGER_CHARACTERS.matcher(text).replaceAll(""); } }