| <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html lang="en-us" xml:lang="en-us"> |
| <head> |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> |
| <meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" /> |
| <meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" /> |
| <meta content="public" name="security" /> |
| <meta content="index,follow" name="Robots" /> |
| <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /> |
| <meta content="task" name="DC.Type" /> |
| <meta name="DC.Title" content="Adding pattern facets to simple types" /> |
| <meta name="abstract" content="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." /> |
| <meta name="description" content="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." /> |
| <meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="DC.subject" /> |
| <meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="keywords" /> |
| <meta scheme="URI" name="DC.Relation" content="../topics/taddsmpt.html" /> |
| <meta content="XHTML" name="DC.Format" /> |
| <meta content="taddreg" name="DC.Identifier" /> |
| <meta content="en-us" name="DC.Language" /> |
| <link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" /> |
| <title>Adding pattern facets to simple types</title> |
| </head> |
| <body id="taddreg"><a name="taddreg"><!-- --></a> |
| |
| |
| <h1 class="topictitle1">Adding pattern facets to simple types</h1> |
| |
| |
| |
| |
| <div><p>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.</p> |
| |
| <div class="section"><p> The value of the pattern is called a regular expression. You |
| can specify it using the <span class="uicontrol">Regular Expression</span> wizard.</p> |
| <p>To |
| add a pattern to a simple type:</p> |
| </div> |
| |
| <ol> |
| <li class="stepexpand"><span>In the Design view, select the simple type you want to work with.</span> |
| </li> |
| |
| <li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">Constraints</span> tab, |
| then <span class="uicontrol">Patterns</span>.</span></li> |
| |
| <li class="stepexpand"><span>Click <span class="uicontrol">Add</span>.</span> The Regular Expression |
| wizard opens.</li> |
| |
| <li class="stepexpand"><span>Select the token you want to add to the expression.</span></li> |
| |
| <li class="stepexpand"><span>Indicate how often you want the token to appear in order for a |
| match to succeed:</span> |
| <ul> |
| <li>If you want the token to repeat, click <span class="uicontrol">Repeat</span> and |
| specify the number of times the token must appear.</li> |
| |
| </ul> |
| |
| <ul> |
| <li> If you want to specify a minimum and maximum number of times the |
| token can appear, click <span class="uicontrol">Range</span> and enter a minimum and |
| maximum value.</li> |
| |
| </ul> |
| |
| </li> |
| |
| <li class="stepexpand"><span>To add the token to the regular expression, click <span class="uicontrol">Add</span>. </span> |
| </li> |
| |
| <li class="stepexpand"><span>To create the entire expression, repeat steps 4 - 6 as necessary.</span> |
| </li> |
| |
| <li class="stepexpand"><span>When you are finished, click <span class="uicontrol">Next</span>.</span> |
| </li> |
| |
| <li class="stepexpand"><span>(Optional) To test against the regular expression and see if a |
| match occurs, enter sample text.</span></li> |
| |
| <li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span> The regular |
| expression will appear in the Patterns page. <div class="tip"><span class="tiptitle">Tip:</span> To edit an |
| existing pattern, select it in the Patterns page and click <span class="uicontrol">Edit</span>. |
| To delete an existing pattern, select it in the Patterns page and click <span class="uicontrol">Delete</span>. </div> |
| |
| </li> |
| |
| </ol> |
| |
| </div> |
| |
| <div><div class="reltasks"><strong>Related tasks</strong><br /> |
| <div><a href="../topics/taddsmpt.html" title="Simple types are used to create derived datatypes. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype.">Adding simple types</a></div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |