ISO IEC 19075-1:2021 pdf download – Information technology — Guidance for the use of database language SQL — Part 1: XQuery regular expressions.
A first stop in answering this is to look at the definition of <XML query> in ISO/IEC 9075-14, which requires XML 1.0 as a basic level of support, and permits XML 1.1 support in the form of Feature X211, “XML 1.1 support”. So, character string can be normalized according to either XML 1.0 or XML 1.1 as an implementation-defined choice, or perhaps via a conformance feature. However, some of the line terminators, even in XML 1.0, are two-character sequences. XML normalizes its input, which means that such two-character sequences are converted to a single character. This changes the relative position of every subsequent character, which would cause unexpected results for POSI- TION_REGEX. Our solution is to look to Unicode Technical Standard #18, a Unicode standard containing guidelines for regular expression processors. This provides a referenceable definition of line terminator that does not require normalizing the subject character string. 4.8 Bracket expressions 4.8.1 Introduction to bracket expressions So far, this Clause has shown how to match a specific character or any character from certain predefined sets of characters. Using bracket expressions, applications can specify user-defined group of characters. (XML Schema and XQuery call these character class expressions, but the term bracket expression is in common use.)
5 Operators using regular expressions 5.1 Introduction to operators using regular expressions SQL contains five operators that use the XQuery regular expression syntax: 1) LIKE_REGEX — predicate that returns True if a substring of a string matches a regular expression. 2) OCCURRENCES_REGEX — numeric function returning the number of matches for a regular expression in a string. 3) POSITION_REGEX — numeric function returning the position of the start of a match for a regular expression in a string, or the position of the next character after a match. 4) SUBSTRING_REGEX — character string function returning a substring that matches a regular expression in a string. 5) TRANSLATE_REGEX — character function that performs a replacement operation on one or all matches to a regular expression in a string.
— START indicates that the starting position of the match to the regular expression is desired; AFTER indicates that the character position immediately following the match is desired (START is the default). If the match consumes the last character of the subject string, then AFTER returns the length of the string plus 1 (one). — <XQuery pattern> is a character string expression whose value is an XQuery regular expression. — <XQuery option flag> is an optional character string, corresponding to the $flags argument of the XQuery and XPath Functions and Operators 3.1 function fn: match . — <regex subject string> is the character string to be searched for matches to the <XQuery pattern>. — <start position> is an optional exact numeric value with scale 0 (zero), identifying the character position at which to start the search (the default is 1 (one)). — <char length units> is CHARACTERS or OCTETS, indicating the unit in which <start position> is measured, and the unit in which the returned position is measured (the default is to measure in CHARACTERS). — <regex occurrence> is an optional exact numeric value with scale 0 (zero) indicating which occurrence of a match is desired (the default is 1 (one)).