Analyzing and compiling regular expressions with Brzozowski's regular expression derivatives