There are lots of great services in this document, including:
pub.string:length
pub.string:numericFormat
and many more!
You could get the length of the variable and compare it to your maximum.
There is no standard built-in service to check if a value is numeric, but you can write a java service to do that. Or if you have the PSUtilities package, there is an isNumeric service in there.
OR
If you want to throw an error (or catch one and set your value to null) if the value is not numeric, you can call the numericFormat service.