The error is right in the beginning:
Code:
9*[45679]( *[0-9]){6}
9* says that 9 is optional. The string may or may not start with a 9.
Also, note that the "4" in "test 4" is also matched incorrectly because of that.
This regex works better:
Code:
9[45679]( *[0-9]){6}
But I'm not too sure because the specification is not clear. When you say "followed by 6 more numbers," the distribution of numbers and spaces is not predictable. You provide four different models in your test lines.
Maybe this will work even better:
Code:
9[45679] [0-9 ]{7,8}
But again, I can't be sure because I'm not sure of the specification.