I can’t seem to find an expression that fits my needs exactly, I need to validate a TextBox representing a double value extracted from a database. The column in the table has a numeric precision so I need a Regex expression that will keep the length of the double value to fit the, say, precision of 19 of the table column. It can be empty but can’t exceed the limit of the field.
To be exact the database column value is an OleDbType.Currency, however it translates to either double or integer when i retrieve the data type i believe.
If anyone has an expression to fit my needs I appreciate it
I think I need more of an example of the data in the table, too. But would something like this start to get there:
-?\d+(\.\d{1,x})?Breaking it down:
-?is for an optional minus sign.\d+is for some amount of digits(\.\d{1,x})?is for an optional group of a decimal point followed by at least one digits, through at most x digits. for x, subtitute the maximum precision or scale you know it can have.