August 1999
Intermediate to advanced
1488 pages
72h 53m
English
regexp.source
The source property of the RegExp object represents the text being used for pattern matching.
Listing 6.225 shows how the source property is used.
<html>
<body>
<script language="JavaScript">
<!–– Hide
exp = new RegExp("am", "g");
str = "This is just a sample sentence.";
myArray = exp.exec(str);
document.write("The source is: " + "<b>" + exp.source + "</b>");
// End Hide ––>
</script>
</body>
</html>
|
Read now
Unlock full access