0
괄호와 그 사이의 모든 것을 제거하는 정규식이란 무엇입니까? 자바 정규식 찾기 및 바꾸기
input = "hello world (this is a test1) (test 2) hello";
output = "hello world hello";
나는 시도했다 : 당신은 앞으로 사용
str.replaceAll("//(.*?//)", "");
괄호와 그 사이의 모든 것을 제거하는 정규식이란 무엇입니까? 자바 정규식 찾기 및 바꾸기
input = "hello world (this is a test1) (test 2) hello";
output = "hello world hello";
나는 시도했다 : 당신은 앞으로 사용
str.replaceAll("//(.*?//)", "");
는 (
및 )
특수 문자를 이스케이프 문자를 슬래시. 백 슬래시를 사용해야합니다.
String output = input.replaceAll("\\(.*?\\)", "");