The regex still matches WIDTH
– it just doesn't put it into a capture group. Your regex is equivalent to
WIDTH\s+[0-9]+
Your code extracts the whole substring that was matched by the regex. (Non-)Capture groups do not change this.
You can use a lookbehind to assert that a certain string comes before the current position, without including it in the matched substring:
(?<=WIDTH\s)[0-9]+
Depending on the exact regex engine, you cannot use variable-length patterns in a lookbehind. There is another form that can allow this:
WIDTH\s+\K[0-9]+