Flow control for using regular expressions