Use expressões regulares para separar todas as marcas de pontuação em uma string
A cópia do código é a seguinte:
<Script Language = "JavaScript">
var str = "jfkldsjalk, .23 @#! $$ k ~! @#$%^&*() (_+-= |/{} [] ';:./<> gg g ~` `` gf ";
str = str.Replace (/[/|/~ |/`|/! |/@|/#|/$ |/%|/^|/& |/*|/(|/) |/-|/_ |/+|/= |/| // |/[|/] |/{|/} |/;/|/|/'/,/|/, [|/] |/{|/} |/;/|/|/'/,/,/, [|/] |/{|/} |/;/|/|/'/,/,/, [|/] |/ware
alerta (str);
</script>
Extraia o texto chinês HTML usando expressões regulares
A cópia do código é a seguinte:
<Script Language = "JavaScript">
str = '<html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> unt tits </title;
str = str.Replace (/<[^>]*> |/g, "");
alerta (str);
</script>