|
|
JavaScript source Property
JavaScript RegExp Object
Definition and Usage
The source property returns the text of the RegExp pattern.
Syntax
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 »
|
JavaScript RegExp Object
|
|
|