Every group to be captured has to have its own explicit set of parentheses in the regex. You can't populate $2, $3, $4, and $5 by putting a quantifier after the 2nd group.
So you'll probably want to do this in two steps. I'll pretend you have a $float regex and a $non_num regex: