package test;
public class test {
public static void main(String[] args) {
String target = "\r\n\r\nHello World. ";
// ^\t : 처음 탭
// ^\t|\t$ : 처음과 끝 탭
// ^\\s+|\\s+$ : 처음과 끝 공백
//String regEx = "^\t|^\r\n|\t$";
String regEx = "^\\s+|\\s+$";
System.out.println(target);
System.out.print(target.replaceAll(regEx, "*"));
}
}
blog.naver.com/dp3554/222031724017
blog.naver.com/horajjan/220461478650
stackoverflow.com/questions/15625629/regex-expressions-in-java-s-vs-s