Fix regexp conditional bug