// .test(string) is a method of the RegExp class
// returns a boolean value
// .match(regexp) is a method of the String class
// if global flag (g) is included, returns an array of matched instances
const str = "A text string!";
const reg = /t/g; // matches all lower case "t"s
reg.test(str); // returns true
str.match(reg); // returns ['t', 't', 't']