Regular expression reduction