JavaScript source 属性
最后更新于:2022-03-26 22:07:30
JavaScript source 属性
JavaScript RegExp 对象
定义和用法
source 属性用于返回模式匹配所用的文本。
语法
浏览器支持





所有主要浏览器都支持 source 属性。
实例
实例
返回与正则模式匹配的文本:
var str="Visit RUNOOB";
var patt1=/RUN/g;
document.write("The text of the RegExp is: "+patt1.source);
尝试一下 »
JavaScript RegExp 对象