JavaScript source property
Definition and Usage
source property is used to return to the pattern matching used text.
grammar
RegExpObject.source
Browser Support
All major browsers support source property.
Examples
Examples
Returns regular pattern matching text:
<script>
var str="Visit W3CSchool";
var patt1=/W3C/g;
document.write("The text of the RegExp is: " + patt1.source);
</script>
var str="Visit W3CSchool";
var patt1=/W3C/g;
document.write("The text of the RegExp is: " + patt1.source);
</script>
try it"
JavaScript RegExp Object