I have two regular expressions that validate the values entered.
One that allows any length of Alpha-Numeric value:
@\"^\\s*(?[A-Z0-9]+)
If it's single line, you could specify that your match must happen at the end of the line, like this in .net ...
^\s*([0-9]{10})\z
That will accept 1234567890 but reject 12345678901.