From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript source Property


RegExp Object Reference JavaScript RegExp Object

Definition and Usage

The source property returns the text of the RegExp pattern.

Syntax

RegExpObject.source


Example

Example

Return the text of the RegExp pattern:

<script type="text/javascript">

var str="Visit W3Schools";
var patt1=/W3S/g;
document.write("The text of the RegExp is: " + patt1.source);

</script>

Try it yourself »


RegExp Object Reference JavaScript RegExp Object

From http://www.w3schools.com (Copyright Refsnes Data)