The following example defines a property schema for a custom field type called "RegularExpressionMatch." The schema declares a field for use by column creators when they base a column on the field type. The purpose of the field is to enable a column creator to set a different regular expression for each column she bases on the RegularExpressionMatch field type.
The DisplayName and an editable Text field will appear in the Additional Column Settings section on the New Site Column page and the Create Column page. The MaxLength attribute sets the maximum length, in characters, of the regular expression and the DisplaySize sets the size of the field that holds it. Users can scroll within the field to see the rest of the regular expression if it is longer than DisplaySize.
No default has been set in this example, but if the developer of the field type knew that in most cases it would be used to create columns containing American telephone numbers, the developer could set the default as <Default>^(\d{3})\d{3}-\d{4}$</Default>.
Note: The following code example has been edited for clarity.
<FieldType>
<Field Name="TypeName">RegularExpressionMatch</Field>
…
<PropertySchema>
<Fields>
<Field Name="RegularExpression"
DisplayName="Regular Expression To Match"
MaxLength="500"
DisplaySize="100"
Type="Text">
<Default></Default>
</Field>
</Fields>
</PropertySchema>
…
</FieldType>