// test 1 function myfun(id) { /* this is mutilcomments "string" keyword: function */ var str = "this is a string, /*fasasdf*/ //fdsasdf /^reg/"; var reg = /^fdadfasdf$/ig; return "myvalue"; // hahah } //test 2 if(str.match(/(?:(?:[!=(,:]|\[|\n)[ \t]*\/$)|^\n?[\t ]*\/$/)){} //test 3 a = 1 b = 2 g = {test:function(){return 1}} c = a// /* */ /b/g.test(); alert(c); // test 4 function t4(test) { return (test/* /* // ' " { ; \*/ && // /* // " ' { ; \ test && " /* // \ \" ' \ { ;" && ' /* // \ " \' \ { ;' && test); } var str = "sfsefsfsf\ sfesfsefs"; // test 5 var rexT5 = /[\/][+]([\S\s]*?)(?:[+][\/]|$)|[\/][\/](.*)|"((?:\\"|[^"])*)"|'((?:\\'|[^'])*)'/g; //正则 var nu = 1/2/3 //这是除法 var str = "123//456".replace(/[\/]/g,'')+1/2/3; //comment var o=[/re/,(/re/),typeof /re/,function(){return /re/},'o' in /re/,1 / /re/,!/re/];
test