# Regular Expressions and Derivatives

When you’re working with regular languages specified in regular expression form, there’s a really cool idea that you can use for building regular expression matchers, and for describing how to convert from a regular expression to a NFA. It’s called the Brzozozwksi derivative of a regular expression – or just simply the derivative of a regexp.

The basic idea of the derivative is that given a regular expression, $r$, you can derive a new regular expression called the derivative with respect to symbol $c$, $D_c(r)$. $D_c(r)$ is a regular expression describing the string matched by $r$ after it’s matched an $r$.