How to use JavaScript source Property

This article describe about JavaScript source Property.
  • 1794

JavaScript source Property

It is return the text of the RegExp pattern.

Syntax

RegExpObject.source

Example

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

 

    var str = "This is a good boy";

    var pattern = /boy/g;

    document.write("The text of the RegExp is: " + pattern.source);

 

</script>

</body>

</html>

 

Output

 

pic3.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.