fix square brackets in regex