Techniques for Manipulating Regular Expressions