Java Reference
In-Depth Information
xsi:schemaLocation="http://ns.soacookbook.com/cart
Cart.xsd">(888) 999-0101</cart:usPhone>
While not part of a regular expression, you can add other schema constraints regarding the
length of acceptable values:
...
<xs:restriction base="xs:string">
<xs:pattern value="..."/>
<xs:minLength value="10"/>
<xs:maxLength value="16"/>
</xs:restriction>
...
Table 2-1 offers an overview of some of the most commonly used regular expression con-
structs.
Table2-1.Common regular expression constructs
\d Any digit 0-9
\D The disjoint of \d
\s Space or tab character
\S The disjoint of \s
\w A word: upper- or lowercase letter, number, or underscore
\W The disjoint of \w
. Any single character
? Zero or one occurrence
* Zero or more occurrences
+ One or more occurrences
Table 2-2 illustrates the key metacharacters, which obtain meaning in constructing regular ex-
pressions.
Search WWH ::




Custom Search