문자열의 두 부분 사이에 있는 텍스트를 제거하려면 JavaScript 정규식을 사용하십시오.
예시
다음 코드를 실행하여 괄호 사이의 텍스트를 제거하는 방법을 배울 수 있습니다. −
<html>
<head>
<script>
var str = "Welcome to Qries (website)";
document.write(str);
// Removing text between parentheses
document.write("<br>"+str.replace(/ *\([^)]*\) */g, ""));
</script>
</head>
<body>
</body>
</html> 출력
