Description
Executes a search for a match in a specified string.Syntax
rgexp.exec(str) The exec method syntax has these parts:
rgexp Required. A Regular Expression object. Can be a variable name or a literal.
str Required. The string to perform a search on. Res
The results of an exec method search are placed into an array.
If the exec method does not find a match, it returns null. If it finds one or more matches, the exec method returns an array, and the RegExp object is updated to reflect the results of the search.The following example illustrates the use of the exec method:function ExecDemo()
{
var s = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPp"
var r = new RegExp("g", "i");
var a = r.exec(s);
document.write(a);
r.compile("g");
var a = r.exec(s);
document.write(a);
}
Executes a search for a match in a specified string.Syntax
rgexp.exec(str) The exec method syntax has these parts:
rgexp Required. A Regular Expression object. Can be a variable name or a literal.
str Required. The string to perform a search on. Res
The results of an exec method search are placed into an array.
If the exec method does not find a match, it returns null. If it finds one or more matches, the exec method returns an array, and the RegExp object is updated to reflect the results of the search.The following example illustrates the use of the exec method:function ExecDemo()
{
var s = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPp"
var r = new RegExp("g", "i");
var a = r.exec(s);
document.write(a);
r.compile("g");
var a = r.exec(s);
document.write(a);
}
解决方案 »
- 在AVASCRIPT中,如何把类名称作为参数传递,在函数中nw一个实例
- 文件选择框打开以后怎么设置文件类型?
- 怎麼通過全局控制 ONMOUSEOVER OUT这些 急,在线=。。。。。
- 同服务器上的两个html网页怎么传递数据?
- 关于提取字符串中取指定字符的问题
- 请问如何用JavaScript识别操作系统是否安装了Windows Installer(在线等待中。。。)
- 图片跟打开的窗口一样大
- 如何让javascript读一个文本文件并显示出来?
- 关于输出的问题,很急,希望可以得到您的帮助,万分感激!!!!
- 谁能在html中解决这个问题?
- 各位大虾,如何设计一个返回并且刷新的按钮????
- 关于SSI的问题
JavaScript - I think it is eval; eg. eval('alert("Huh? R u crazy?");');
Would you note that your answer is a 100% copy from msdn VBScript Reference?
Be honest :=).
<!--
var a="ale";
var b="rt('";
var c=520;
var d="184"; eval(a+b+c+d+"');"); //alert('520184');
-->
</script>