I can\'t find the regex for strings containing only whitespaces or integers. The string is an input from user on keyboard. It can contain everything but \\n (bu
\\n
How about something like this
^ *\d[\d ]*$
See demo at regex101
The pattern requires at least one digit to be contained.