This function will not accurately identify a numeric number. The following are some valid inputs for a double precision number in Vertica that the function above will mark as not numeric:+0.11.89e-10The following are some inputs that the function would flag as numeric that Vertica will not accept:.00.0.0.0.-----Your regex should be more like'^[-\+]?([0-9]+.?[0-9]*|[0-9]*.?[0-9]+)([Ee][-+]?[0-9]+)?$'
This function will not accurately identify a numeric number.
ReplyDeleteThe following are some valid inputs for a double precision number in Vertica that the function above will mark as not numeric:
+0.1
1.89e-10
The following are some inputs that the function would flag as numeric that Vertica will not accept:
.00.0.0.0.
-----
Your regex should be more like
'^[-\+]?([0-9]+.?[0-9]*|[0-9]*.?[0-9]+)([Ee][-+]?[0-9]+)?$'