Usage:
Example:
/** Positive integer matching expression */
VaR pattern =/^ [0-9] * [1-9] [0-9] * $ /;
VaR flag = pattern. Test ();
If a is a positive integer, the Boolean value of flag is true. If a is not a positive integer, the Boolean value of flag is false.
/** Floating point match expression */
VaR pattern =/^ ([-]) {0, 1} ([0-9]) {1,} ([.]) {0, 1} ([0-9]) {0,} $ /;
/** Floating point match expression with only two decimal places reserved */
VaR pattern =/^ -? \ D + [\. \ D]? \ D {0, 2} $ /;
/** Regular floating-point match expression */
VaR pattern =/^ ([0-9] + \. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $ /;
/** Positive floating point number and retain two decimal match expressions */
VaR pattern =/^ ([1-9] \ D * (\. \ D? [0-9])?) | (0 \. [1-9] [0-9]) | (0 \. [0] [1-9]) $ /;
/** Match expression of negative Floating Point Number */
VaR pattern =/^ (-([0-9] + \. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $ /;
/** Negative floating point number and retain two decimal match expressions */
VaR pattern =/^-([1-9] \ D * (\. \ D? [0-9])?) | (0 \. [1-9] [0-9]) | (0 \. [0] [1-9]) $ /;
/** Negative floating point number + 0 matching expression */
VaR pattern =/^ (-\ D + (\. \ D + )?) | (0 + (\. 0 + )?)) $ /;
/** Negative floating point number + 0 and retain two decimal match expressions */
VaR pattern =/^ (-\ D + [\. \ D]? \ D {0, 2}) | (0 + (\. 0 + )?)) $ /;
Positive floating point + 0 matching expression
VaR pattern =/^ \ D + (\. \ D + )? $ /;
/** Positive floating point + 0 matching expression with only two decimal places reserved */
VaR pattern =/^ \ D + [\. \ D]? \ D {0, 2} $ /;
/** Integer matching expression */
VaR pattern =/^ -? \ D + $ /;
/** Positive integer matching expression */
VaR pattern =/^ [0-9] * [1-9] [0-9] * $ /;
/** Negative integer matching expression */
VaR pattern =/^-[0-9] * [1-9] [0-9] * $ /;
/** Positive integer + 0 matching expression */
VaR pattern =/^ \ D + $ /;
/** Match expression of negative integer + 0 */
VaR pattern =/^ (-\ D +) | (0 +) $ /;
/** All are digit matching expressions */
VaR pattern =/^ [0-9] {1, 20} $/