I am trying to allow an empty string or null string in my regular expression:
^[0-9][0-9]*
what should I add to achieve this, thanks
Are you trying to check to see if a string is empty? (as in only has whitespace) If so ^\w*$ would match such a string.
Also, you mentioned a null string. Depending on what language you're using, passing a NULL pointer to a regex function may result in a segfault.
\w matches a word character, i.e., [A-Za-z0-9_]. The shorthand for whitespace is \s.