Use lscpu --json instead of parsing text
Should be more reliable than regex, although the keys look basically the same.