Skip to main content
hardNeetCode 150

Regular Expression Matching

Check if string s matches pattern p '.' matches any single character '*' matches zero or more of the preceding element Example: s = "aa", p = "a" => false (doesn't cover entire string) Example: s = "aa", p = "a*" => true ('*' means zero or more 'a') Example: s = "ab", p = ".*" => true ('.*' matches any string)

Regular Expression Matching is about turning repeated work into a reusable state instead of re-solving subproblems. It's a hard one for a reason: it stresses state-and-transition thinking when the rules pile up. Don't rush the code—spend your time nailing the state definition first.

StringBacktrackingDynamic Programming

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Regular Expression Matchinghard
Based onLeetCode