Use regex to remove special characters but also keep greek characters - Javascript String Operation

Javascript examples for String Operation:String Replace

Description

Use regex to remove special characters but also keep greek characters

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from   w w w . j a va 2  s .c om*/
var stringToReplace = "some unicode s & /(";
var result = stringToReplace.replace(/[^\u0370-\u03FF\w\s]/mg, "");
console.log(result);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials