I am trying to create a regex to have a string only contain 0-9 as the characters and it must be at least 1 char in length and no more than 45. so
0-9
45
A combination of both attempts is probably what you need:
^[0-9]{1,45}$