← Back to all problems
Hard

Regular Expression Matching

Updated Feb 24, 2026

Problem

Implement regex matching with support for '.' and '*'.

Constraints

1 <= s.length <= 20

Examples

Example 1

Input: {"s": "aa", "p": "a"}
Output: false

Function Signature

def isMatch(self, s: str, p: str) -> bool

How to Submit

Implement a Solution class with a isMatch method.

Your method will be called with the input parameters and should return the answer.