If it's for South African ID's only, then I would recommend using the validate South African ID Number and extract DOB widget from the appstore:
Otherwise I would just google for a valid regex and test it. An example for UK passport number can be find here
See this question: https://forum.mendix.com/questions/3133/Using-regex-in-a-microflow. This one should work if you only want digits.
I am not sure what it is that you want? Should the regex check if a string consists just of numbers or should it validate that the regex consist of a certain mix of white spaces ,characters and special characters?
Anyway if it should check if a string is just a number use something like