function MatchDemo(){
// Declare variables.
var r, re;
var s = "through the pages of this book";
// Create regular expression pattern.
re = /th/ig;
// Attempt match on search string.
r = s.match(re);
// Return array containing all three
// occurrences of "th".
return(r);
}