var str = "한글 <!-- 주석 --> <script type="text/javascript">window.alert('hellow')<\/script>"; str += "<style type='text/css> td {font-size:9pt;}<\/style>"; str += "<br /> <h3>Hellow Blog</h3>";
//태그제거 var RegExpTag = "<[^<|>]*>"; str = str.replace(RegExpTag,""); //result : 한글 window.a lert('hellow'); td {font-size:9pt;} Hellow Blog
//스크립트 제거 var RegExpJS = "<script[^>]*>(.*?)</script>"; str = str.replace(RegExpJS,""); //result : 한글 <!-- 주석 --> <br> <h3>Hellow Blog</h3>
//스타일 제거 var RegExpCSS = "<style[^>]*>(.*?)"; str = str.replace(RegExpCSS,""); //result : 한글 <!-- 주석 --> <script type="text/javascript">window.a lert('hellow');</script><br></style[^><h3>Hellow Blog</h3>
//한글 제거 var RegExpHG = "[ㄱ-ㅎ가-힣]"; str = str.replace(RegExpHG,""); //result : <!-- 주석 --> <script type="text/javascript">window.a lert('hellow');</script><br><h3>Hellow Blog</h3>
//주석 제거 var RegExpDS = /<!--[^>](.*?)-->/g; str6 = str.replace(RegExpDS,""); //result : 한글 <script type="text/javascript">window.a lert('hellow');</script><br><h3>Hellow Blog</h3>