I want to check whether the given string input is a number of six digits.
Valid:
* 123456
* 098765
Invalid:
* 123
* 12345a
* as3445
* /n123456
* 123456\n
My Python code:
bool(re.match("^[0-9]{6}$",string))
but this also matches "123456\n".
Why it is matching newline character and how to restrict this match?
^[0-9]{6}\Z