Regex negative match query
I've got a regex issue, I'm trying to ignore just the number '41', I want 4, 1, 14 etc to all match. I've got this [^\b41\b] which is effectively what I want but this also ignores all single iterations of the values 1 and 4. As an example, this matches "41", but I want it to NOT match: \b41\b Try something like: \b(?!41\b)(\d+) The (?!...) construct is a negative lookahead so this means: find a word boundary that is not followed by "41" and capture a sequence of digits after it. You could use a negative look-ahead assertion to exclude 41 : /\b(?!41\b)\d+\b/ This regular expression is to be