Matches words NOT followed by a specific pattern using negative lookahead.
/\b\d+(?!\s*px)\b/g
const regex = /\b\d+(?!\s*px)\b/g; const result = str.match(regex);
import re pattern = re.compile(r'\b\d+(?!\s*px)\b') result = pattern.findall(text)
import "regexp" re := regexp.MustCompile(`\b\d+(?!\s*px)\b`) result := re.FindAllString(text, -1)