Javascript examples for String Operation:String Replace
Use regex to remove special characters but also keep greek characters
<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>