Search
⌘K

Leetcode 10. Regular Expression Matching

Determine whether a pattern p (with '.' matching any single character and '*' meaning zero or more of the preceding element) matches the entire string s. The core challenge is handling the branching choices introduced by '*' and overlapping subproblems, typically solved with recursion+memoization or dynamic programming.

Asked at:

Amazon

Amazon

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid March, 2026

Microsoft

Microsoft

Staff

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where: '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). '.' Matches single character '^' Check if it starts with certain didgit The matching should cover the entire input string (not partial).

Late January, 2026

Amazon

Amazon

Mid-level

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character.​​​​ '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial).

Your account is free and you can post anonymously if you choose.