Skip to content
StackDecode
Dynamic programmingExplained

Regular Expression Matching

Match with . and * by building on smaller prefixes.

Time

O(n · m)

Extra space

O(n · m)

Use it for

Core of simple regex engines.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.