A regular expression, or 'regex', is used to match parts of a string. Below is my cheat sheet for creating regular expressions. Testing a regex Use the .test() method let testString = "My test string"; let testRegex = /string/; testRegex.test(testString);