Javascript RegExp教程

JavaScript RegExp 构造函数

说明

它返回对创建实例原型的数组函数的引用。

语法

其语法如下-
RegExp.constructor

返回值

返回创建此对象实例的函数。

示例

以下示例显示了 RegExp 表达式的用法。
<html>   
   <head>
      <title>JavaScript RegExp constructor Property</title>
   </head>
   
   <body>      
      <script type = "text/javascript">
         var re = new RegExp( "string" );
         document.write("re.constructor is:" + re.constructor); 
      </script>      
   </body>
</html>

输出

re.constructor is: function RegExp() { [native code] } 
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4