Using the Test Method
Summary
- Regular expressions are used in programming languages to match parts of strings.
- The
.test()
method takes the regex, applies it to a string (which is placed inside the parentheses), and returns true
or false
.
Final Code