返回到:JavaScript对象:JavaScript RegExp 对象
source 属性用于返回模式匹配所用的文本。
RegExpObject.source
RegExpObject.source
返回与正则模式匹配的文本:
<!DOCTYPE html> <html> <body> <script> var str="Visit web176"; var patt1=/web/g; document.write("The text of the RegExp is: "+patt1.source); </script> </body> </html>