자바) regex/ generics (23-05-11)
velog에서 이전한 글 입니다. 23.5.2 ~ 23.5.19 사전 캠프 기간의 TIL 기록입니다! TIL: Today I Learned 정규표현식(regex) public class Main { public static void main(String[] args) { String t = "^[0-9]*$"; String res = "1597asd123".replaceAll(t, "yes"); System.out.println(res); String res2 = "".replaceAll(t, "yes"); System.out.println(res2); String res3 = "1235512".replaceAll(t, "yes"); System.out.println(res3); } } 결과 1597as..
2023.07.13