Parsing and Evaluating Regular Expressions with Derivatives