I\'m trying to check if a string is a number, so the regex \"\\d+\" seemed good. However that regex also fits \"78.46.92.168:8000\" for some reason, which I do not want, a l
\d+ matches any positive number of digits within your string, so it matches the first 78 and succeeds.
\d+
78
Use ^\d+$.
^\d+$
Or, even better: "78.46.92.168:8000".isdigit()
"78.46.92.168:8000".isdigit()