Exact match

Any sequence of characters that's not a special RegEx character or operator represents a character literal:

var pattern = /orange/;

We mean o followed by r followed by a followed by n followed by …—you get the point. We rarely use exact match when using RegEx because that is the same as comparing two strings. Exact match patterns are sometimes called simple patterns.

Get JavaScript: Functional Programming for JavaScript Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.