: at the start of the parenthesis content to tell the regex engine not to do so. $/; Dear Webdev, So samples which I want to allow will be 23, 23.1,56.1,67 etc. See the backreferences section for more details on this. Meaning that I want only 2 number before the decimal and one number after the decimal. The minimum will 2 digit numbers and that is mandatory. My problem now user can put two or more decimal and I want to limit just to single decimal and only 2 numbers before the decimal? within the optional section is for a fullstop[09] after the fullstop is for any number of numbers following it As an extra, of you don't want a backreference created for the parenthesis part, you can use ? Does it mean 2 or more decimal points or decimal numbers. Do you want up to 2 numbers before the decimal point or up to 2 numbers before the decimal point? $/; [09] is for any number of numerals before the decimal point(...)? Now that the input from both sides was coerced to the same type from the same original value, you would think they should always be the same (always true). However, there's a special rule that says , and so a value that can't be converted to a number (and only values that cannot be converted to numbers) will result in false.
