refactor regex tests