How do I match an entire string with a regex?

Try the following regular expression:

^Red October$

By default, regular expressions are case sensitive. The ^ marks the start of the matching text and $ the end.

Leave a Comment