Regex Full Match Problem

Regex Full Match Problem — ExecCode Hard DSA Practice

Solve the Regex Full Match problem on ExecCode. Free online hard DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Implement full-string matching for a tiny regex: letters, '.' (any one char), and '' (zero or more of the previous token). The match must consume the entire string. Return true if p matches s entirely, else false. You are given: s — text, lowercase or empty p — pattern with '.', '' Return boolean. An empty pattern matches only an empty string.

Examples

Input {'s': 'aa', 'p': 'a'}; Output False. Input {'s': 'aa', 'p': 'a'}; Output True. Input {'s': 'ab', 'p': '.'}; Output True

Constraints

'*' always follows a token (letter or '.') Matching is the whole string, not a substring

Practice Regex Full Match free on ExecCode. Browse DSA problems, topic map, and placement guides.