Functiondojox.regexp.numberFormat

dojo.require("dojox.validate.regexp");
defined in dojox/validate/regexp.js

Use this method for phone numbers, social security numbers, zip-codes, etc. The RE can match one format or one of multiple formats.

Format

Stands for a digit, 0-9.

? Stands for an optional digit, 0-9 or nothing. All other characters must appear literally in the expression.

Example "(###) ###-####" -> (510) 542-9742 "(###) ###-#### x#???" -> (510) 542-9742 x153 "###-##-####" -> 506-82-1089 i.e. social security number "#####-####" -> 98225-1649 i.e. zip code

Usage

function (/*Object?*/ flags) (view source)
parametertypedescription
flagsObjectOptional. format A string or an Array of strings for multiple formats.