| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source Property (Regular Expression) (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
|
d58ac57e-fcde-49d1-bbba-e8c4218448c4 |
9 |
mikejo5000 |
mikejo |
ghogen |
Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal.
rgExp.source
The following example illustrates the use of the source property:
function SourceDemo(re, s){
var s1;
// Test string for existence of regular expression.
if (re.test(s))
s1 = " contains ";
else
s1 = " does not contain ";
// Get the text of the regular expression itself.
return(s + s1 + re.source);
} [!INCLUDEjsv3]
Applies To: Regular Expression Object
Regular Expression Object
Regular Expression Object
Regular Expression Syntax (JavaScript)