Pattern syntax : pattern « XML Schema « XML Tutorial






.          for any character at all
\d         for any digit; 
\D         for any non-digit
\s         for any white space (including space, tab, newline, and return); 
\S         for any character that is not white space
x*         to have zero or more x's; 
(xy)*      to have zero or more xy's
x?         to have one or zero x's; 
(xy)?      to have one or no xy's
x+         to have one or more x's; (xy)+ to have one or more xy's
[abc]      to include one of a group of values (a, b, or c)
[09]      to include the range of values from 0 to 9
A|B        to have A or B in the content. 
x{5}       to have exactly 5 x's (in a row)
x{5,}      to have at least 5 x's (in a row)
x{5,8}     to have at least 5 and at most 8 x's (in a row)
(xyz){2}   to have exactly two xyz's (in a row).








3.79.pattern
3.79.1.Pattern syntax
3.79.2.list of atoms that match a single character
3.79.3.Character classes
3.79.4.Unicode character classes
3.79.5.User-defined character classes
3.79.6.Meta Characters
3.79.7.These three characters should be used with caution:
3.79.8.A character class expression is simply a character group, enclosed in square brackets
3.79.9.Any single normal character will match only that character
3.79.10.Special regex characters (-[]) cannot be used for the single normal character form of the character range.
3.79.11.Any ASCII letter: adding a second character range to the character group expression
3.79.12.To match a string of any length (including the empty string) that is comprised exclusively of lower-case ASCII letters
3.79.13.Specifying a Pattern for a Simple Type
3.79.14.Pattern for time
3.79.15.You can use patterns to offer choices for an element's content.
3.79.16.Getting rid of leading zeros
3.79.17.Use quantifiers to limit the number of leading zeros-for instance
3.79.18.Merge our three patterns into one
3.79.19.pattern Constrains the lexical space to literals that must match a defined pattern
3.79.20.A phone number
3.79.21.Define a pattern that can be used for zip codes
3.79.22.pattern: USA_SSN datatype