Search⌘ K
AI Features

DIY: Regular Expression Matching

Explore how to implement regular expression matching in JavaScript by creating a function that supports the dot and star operators. Understand the requirements for matching input strings entirely against a pattern, and develop the skills to solve pattern matching problems useful in coding interviews and real-world scenarios.

Problem statement

Suppose you are given an input string s and a pattern p. You have to implement regular expression matching with support for “.” and “*” where:

  • '.' can match any single
...