Regular expressions
-Used in programming languages to match parts of strings.
Test method
-Many ways to test regexes.
Code: -.test() - let myString = "Hello, World!"; let myRegex = /Hello/; let result = myRegex.test(myString); // Change this line
console.log(result);
Match literal strings with different possibilities
Code:
‘|’
myPetRegex = /cat|bird|dog|fish/