Factor out readUtilRegex() to make it reusable