Documentation/OOo3 User Guides/Writer Guide/Form controls reference Pattern field
An input mask is used to control input into the field. Characters are pre-specified for particular positions, determining the properties of entered characters. The preset characters are stored along with the entered ones.
The length of the edit mask determines how many characters may be entered. If the user's entry does not match the mask, the entry is rejected on leaving the control. The following characters are available for defining the edit mask.
|L||A text constant. This position cannot be edited. The actual character is displayed at the corresponding position in the literal mask.|
|a||Represents any of the letters a-z/A-Z. Capital letters are not converted into lower case.|
|A||Represents any of the letters A-Z. If lower-case letters are entered, they will automatically be converted to upper case.|
|c||Represents any of the characters a-z/A-Z plus the digits 0-9. Capital letters are not converted into lower case.|
|C||Represents any of the letters A-Z plus the digits 0-9. If lower-case letters are entered, they will automatically be converted to upper case.|
|N||Only the digits 0-9 can be entered.|
|x||All printable characters are allowed.|
|X||All printable characters are allowed. If lower-case letters are entered, they will automatically be converted to upper case.|
So, for example, you can define the literal mask as "__/__/2017" and the edit mask as "NNLNNLLLLL", to allow the user to enter four characters only for a date specific in 2017.