blob: df9d7b15b544c8baac3c457d6c384bca4600664c [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<task id="taddreg" xml:lang="en-us">
<title>Adding pattern facets to simple types</title>
<searchtitle>Adding pattern facets to simple types</searchtitle>
<shortdesc>A pattern facet can be used to constrain the value of a type's
lexical space (the set of string literals that represent the values of a type),
which indirectly constrains the value space.</shortdesc>
<keywords><indexterm>XML schema editor<indexterm>pattern facets</indexterm></indexterm>
<indexterm>XML schema files<indexterm>pattern facets</indexterm></indexterm>
<context><p> The value of the pattern is called a regular expression. You
can specify it using the <uicontrol>Regular Expression</uicontrol> wizard.</p><p>To
add a pattern to a simple type, complete the following steps:</p></context>
<step><cmd>In the Design view, select the simple type you want to work with.</cmd>
<step><cmd>In the Properties view, click the <uicontrol>Constraints</uicontrol> tab,
then <uicontrol>Patterns</uicontrol>.</cmd></step>
<step><cmd>Click <uicontrol>Add</uicontrol>.</cmd><info>The Regular Expression
wizard opens.</info></step>
<step><cmd>Select the token you want to add to the expression.</cmd></step>
<step><cmd>Indicate how often you want the token to appear in order for a
match to succeed:</cmd>
<choice>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and
specify the number of times the token must appear.</choice>
<choice> If you want to specify a minimum and maximum number of times the
token can appear, click <uicontrol>Range</uicontrol> and enter a minimum and
maximum value.</choice>
<step><cmd>To add the token to the regular expression, click <uicontrol>Add</uicontrol>. </cmd>
<step><cmd>To create the entire expression, repeat steps 4 - 6 as necessary.</cmd>
<step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>
<step><cmd>T<?Pub Caret1?>o test against the regular expression and see if
a match occurs, enter sample text.</cmd></step>
<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd><stepresult> The regular
expression will appear in the Patterns page. <note type="tip"> To edit an
existing pattern, select it in the Patterns page and click <uicontrol>Edit</uicontrol>.
To delete an existing pattern, select it in the Patterns page and click <uicontrol>Delete</uicontrol>. </note></stepresult>
<?Pub *0000002703?>