Several suggestions come to mind. The simplest is to use the "split" function with a pattern of:
/
This will return an array with each element being one of the numbers (possibly with the surrounding whitespace). In this case you gave the option of using the (relatively lightweight) string "split" function or the (relatively heavyweight) regex split operation - either will do as you are splitting on a literal character.
If you really want to follow the approach you have used, then try a pattern of:
^(\d+)\s*/\s*(\d+)(\s*/\s*(\d+))?$
This is basically what you have except that I've used the '\d' shorthand for the '[0-9]' part, and I've used the actual separator character (the '/') and optional whitespaces rather than the "anything but a digit" you use - the '[^0-9]'; I've forced the string to match from the start (the '^') to the end (the '$') of the string (if the value is actually embedded within the string somewhere then take these out); and I've made the last part optional.
If all 3 values are given, then look in match groups #1, #2 and #4 for the characters. If only 2 are given then match group #4 will contain a null string.
This pattern is limited to matching either 2 or 3 values whereas the split approach will match any number of items, separated by a slash (but does not check that they are only digits).
The reason your pattern behaves that way it does is that you require the 3rd value to be present. The only way this can happen is for the 2nd value match to give up a digit - its still happy as it has "one or more" but allows the 3rd part top succeed and the regex engine favours results that provide an overall success to a match.
It would also help if you told us the regex variant you are using as requested in the posting guidelines in the sticky note at the beginning of this forum.
Susan