Description
The source property returns the text of the RegExp pattern.
This property has the form:
RegExpObject.source
Examples
The following example shows the basic use of this property.
<script>
var str = "Hello JavaScript";
var pat = /Java/g;
document.write("Source: " + pat.source);
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|