Javascript examples for RegExp:RegExp test
Split punctuated strings into regular words greater than 2 character
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w . j av a 2s . c o m var str = "this is a test234#$%$%^$%^$%^, is the \"best\" test test test .wer.wer.wer.we.rw.er.w.er!"; str = str.replace(/[^\w\s]/ig, "").replace(/\s/g, ", "); console.log(str); }); </script> </head> <body> </body> </html>