ComponentOne Input for WinForms
Input for WinForms Tutorials / Masked Input Using Regular Expressions
In This Topic
    Masked Input Using Regular Expressions
    In This Topic

    You can use regular expressions in masks for validating more complex input formats using RegexpEditMask of MaskInfo class. The Properties pane showing RegexpEditMask property for c1TextBox control is as shown:

    regexmask

    The keywords in regular expressions and their description is shown in the following table: 

    Keywords Description
    \A Matches any upper case alphabet [A-Z].
    \a Matches any lower case alphabet [a-z].
    \D Matches any decimal digit [0-9].
    \W Matches any word character. It is same as [a-z A-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 [0-9].
    \ W Matches any DBCS word character. It is same as [a-z A-Z 0-9].
    \ K Matches all DBCS Katakana.
    \ J Matches all Hiragana.
    \ Z Matches all DBCS characters.
    \N Matches all SBCS big Katakana.
    \ N Matches all DBCS big Katakana.
    \ G Matches DBCS big Hiragana.
    \ T Matches surrogate character.
    [] Matches a character subset.
    [^] To express an exclude subset.
    - Defines contiguous character range.
    {} Specifies the number of times to match.
    * Specifies zero or more matches. It is the short expression for {0,}.
    + Specifies one or more matches. It is the short expression for {1,}.
    ? Specifies zero or one matches. It is the short expression for {0,1}.