Wijmo UI for the Web
Characters
Wijmo User Guide > Widgets > Input Widgets > InputMask > InputMask Concepts > Characters
To enable masked input, set the mask option to a mask string composed of one or more placeholders and literals. The following table lists available placeholders:

Drop down for masking placeholders

Masking Element Description
0 Digit, required. This element will accept any single digit between 0 and 9.
9 Digit or space, optional.
# Digit or space, optional. Plus (+) and minus (-) signs are allowed.
L Letter, required. Restricts input to alphabetic letters that are members of one of the following UnicodeCategory types: UppercaseLetter, LowercaseLetter, TitlecaseLetter, ModifiedLetter, and OtherLetter.
? Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.
& Character, required.
C Character, optional. Any non-control character.
A Alphanumeric, required.
a Alphanumeric, optional.
. Decimal placeholder. The actual display character used will be the decimal placeholder appropriate to the culture option.
, Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the culture option.
: Time separator. The actual display character used will be the time placeholder appropriate to the culture option.
/ Date separator. The actual display character used will be the date placeholder appropriate to the culture option.
$ Currency symbol. The actual character displayed will be the currency symbol appropriate to the culture option.
Shift down. Converts all characters that follow to lowercase.
> Shift up. Converts all characters that follow to uppercase.
| Disable a previous shift up or shift down.
H All SBCS characters.
K SBCS Katakana.
DBCS Digit
DBCS Katakana
Hiragana
All DBCS characters.
N All SBCS big Katakana.
Matches DBCS big Katakana.
Matches DBCS big Hiragana.
\\ Escape. Escapes a mask character, turning it into a literal.
The escape sequence for a backslash is: \\\\
All other characters Literals. All non-mask elements appear as themselves within wijinputmask. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

Mask Format Keywords

Drop down for advanced mode keywords

Keywords Description
\A Matches any upper case alphabet [A-Z].
\a Matches any lower case alphabet [a-z].
\D Matches any decimal digit. Same as [0-9].
\W Matches any word character. It is same as [a-zA-Z_0-9].
\K Matches SBCS Katakana.
\H Matches all SBCS characters.
\A Matches any upper case DBCS alphabet [A-Z].
\a Matches any lower case DBCS alphabet [a-z].
\D Matches any DBCS decimal digit. Same as [0-9].
\W Matches any DBCS word character. It is same as [a-zA-Z_0-9].
\K DBCS Katakana
\J Hiragana
\Z All DBCS characters.
\N Matches all SBCS big Katakana.
\N Matches DBCS big Katakana.
\G Matches DBCS big Hiragana.
\T Matches surrogate characters.
Sub Keywords Description
[] Used to define a combination character subset.
[^] Used to express an exclude subset.
- Used to define a contiguous character range.
{} Used to define a pattern.
* A shortcut to express {0,}.
+ A shortcut to express {1,}.
? A shortcut to express {0,1}.

Examples of Regex Values

Regex Value Results In
\D{3}-\D{4} Zip Code (012-3456)
℡ \D{2,4}-\D{2,4}-\D{4}/ Phone number (℡ 012-345-6789)
\D{2,4}-\D{2,4}-\D{4} Phone number ( 012-345-6789)

The maskFormat option requires a regular expression value, as in the following examples.

Example
Copy Code
$(".selector").wijinputmask({
    maskFormat: /\D{3}-\D{4}/
});
Example
Copy Code
$(".selector").wijinputmask({
    maskFormat: new RegExp("\\D{3}-\\D{4}")
});
See Also

Widgets

Reference