\d 예제
<button onclick="homzzang()">클릭</button> <p id="demo"></p> <script> function homzzang() { var str = "Homzzang.com 만족도 100%!"; var pat = /\d/g; var res = str.match(pat); document.getElementById("demo").innerHTML = res; } </script> 결과보기 : 1,0,0
<button onclick="homzzang()">클릭</button>
<p id="demo"></p>
<script>
function homzzang() {
var str = "Homzzang.com 만족도 100%!";
var pat = /\d/g;
var res = str.match(pat);
document.getElementById("demo").innerHTML = res;
}
</script>
결과보기 : 1,0,0