Match regex escape errors more explicitly