Utilities for manipulating regular expressions