The 'pattern' element specifes a regular expression for the lexical value.
The book has a whole section on patterns. Read it!!!
If you are familiar with regular expressions, then you'll feel at home.
The syntax is familiar to the java.util.regex package.
A US Zip+4 code:
<xs:simpleType name="ZipPlus4"> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{5}(-[0-9]{4})?"/> </xs:restriction> </xs:simpleType>