\D 예제
<p id="demo"></p> <button onclick="homzznag()">클릭</button> <script> function homzznag() { var str = "홈짱닷컴 Homzzang.com BEST 100%!"; var pat = /\D/g; var result = str.match(pat); document.getElementById("demo").innerHTML=result; } </script> 결과보기 : 홈,짱,닷,컴, ,H,o,m,z,z,a,n,g,.,c,o,m, ,B,E,S,T, ,%,!
<p id="demo"></p>
<button onclick="homzznag()">클릭</button>
<script>
function homzznag() {
var str = "홈짱닷컴 Homzzang.com BEST 100%!";
var pat = /\D/g;
var result = str.match(pat);
document.getElementById("demo").innerHTML=result;
}
</script>
결과보기 : 홈,짱,닷,컴, ,H,o,m,z,z,a,n,g,.,c,o,m, ,B,E,S,T, ,%,!