Possible Duplicate:
Simple regular expression for a decimal with a precision of 2
HI i need to validate a number using regex. The main idea is that i have the integer part, the decimal part and the decimal separator of a number. For example if i have this:
var integer_part = 4;
var decimal_part = 2;
var decimal_separator = ".";
// will be valid numbers
// 2546.33
// 12
// 1.33
// 263
// 0
can i make a regex string with the values in the variables to validate a string ¿?