Representing Any Character
The period (.) has special significance in regular expressions; it matches any character except the line feed character (#xA). The period character represents only one matching character, but a quantifier (such as *) can be applied to it to represent multiple characters. Table 18-6 shows some examples of the wildcard escape character in use.
Table 18-6. The wildcard escape character
It is important to note that the period loses its wildcard power when placed in a character class expression (within square brackets).
Some XQuery functions (namely matches, replace, and tokenize) allow you to indicate that the processor should operate in dot-all mode. This is specified using the letter s in the $flags argument. In dot-all mode, the period matches any character whatsoever, including the line feed character (#xA). See "Using Flags," later in this chapter, for more information.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access