ISO IEC 19075-1 pdf – Information technology — Guidance for the use of database language SQL — Part 1: XQuery regular expressions

08-20-2022 comment

ISO IEC 19075-1 pdf – Information technology — Guidance for the use of database language SQL — Part 1: XQuery regular expressions
2Normative references
The following documents are referred to in the text in such a way that some or all of their content consti-tutes requirements of this document.For dated references,only the edition cited applies.For undatedreferences, the latest edition of the referenced document (including any amendments) applies.
ISO/IEC9075-1, Information technology —Database languages —SQL —Part 1: Framework(sQL/Framework)
ISO/IEC 9075-2, Information technology — Database languages —SQL- Part 2:Foundation(sQL/Foundation)
ISO/IEC 9075-14, Information technology—Database languages—SQL— Part 14:XML-RelatedSpecifications (sQL/XML)
Bray, Tim et al.. Extensible Markup Language (XML) Version 1.0, W3C Recommendation [online].FifthEdition.Cambridge, Massachusetts, USA: w3C, 26 November 2008 . Available at
http: / / www . w3.org / TR/ xml
Bray, Tim et al.Extensible Markup Language (XML) Version 1.1,W3C Recommendation [online].SecondEdition.Cambridge, Massachusetts, USA: W3C,16 August 2006 . Available at
http : / / www . w3.org/TR/ xmll1
Biron, Paul V;Malhotra,Ashok.XML.Schema Part 2:Datatypes, W3C Recommendation [online].SecondEdition.Cambridge, Massachusetts, USA: W3C,28 October 2004.Available at
http: / / www . w3 .org/ TR/ xmlschema-27
Malhotra,Ashok et al.. XQuery and XPath Functions and 0perators 3,1,W3C Recommendation [online].Cambridge,Massachusetts, USA:W3C,21 March 2017.Available at http: / / www.w3.org/TR/-xpath-functions/
The Unicode Consortium. Unicode Regular Expressions [online].21.Mountain View,California,USA:TheUnicodeConsortium,2020-06-17.Availableat http: / / www.unicode.org/reports/tr18/-tr18-21 .html
3Terms and definitions
For the purposes of this document, the terms and definitions given in ISO/IEC 9075-1 apply.
ISO and lEC maintain terminological databases for use in standardization at the following addresses:
– IEC Electropedia: available at http : / / www .electropedia.org/
– ISO online browsing platform: available at http : / / www .iso.org/obp
4 xQuery regular expressions
4.1Context of XQuery regular expressions
The requirements for the material discussed in this document shall be as specified in ISO/IEC 9075-2,ISo/IEC 9075-14,XML 1.0,XML 1.1,XML Schema Part 2: Datatypes,XQuery and XPath Functions andOperators 3.1, and Unicode Technical Standard #18.
4.2Introduction to xQuery regular expressions
This document explains the manner in which XQuery regular expressions are used by database languageSQL in ISO/IEC9075-2 and in ISO/IEC9075-14.Both IlSO/IEC 9075-2 and ISO/IEc 9075-14 specifyrequirements for the material discussed in this document.
XQuery regular expression syntax is specified in XQuery and XPath Functions and Operators 3.1, section5.6.1, “Regular expression syntax”. This paper references the XQuery specification, with two small modi-fications (required since character strings in an RDBMS are not necessarily normalized according to XMLconventions).The following subsections provide an overview of this syntax.
The XQuery regular expression syntax is itself a modification of another regular expression syntax foundin XML Schema Part 2: Datatypes.
This section presents an overview of the capabilities of XQuery regular expression syntax.In the process,this section will illustrate some of the SQL operators.The SQLoperators themselves are presented inClause 5, “Operators using regular expressions”.
The following discussion does not cover every aspect of XQuery regular expressions; for this, XQueryand XPath Functions and Operators 3.1 is the reference (though hardly a tutorial; a variety of popularworks contain detailed treatments of regular expressions).
4.3Matching a specific character
Perhaps the most elementary pattern matching requirement is the ability to match a single character orstring.For most characters, this is done by simply writing the characterin the regular expression.Forexample, suppose an application needs to know if a string S contains the letters “”xyz”.This could be donewith the following predicate:
s LIKE_REGEX ‘xyz’
Note that the SQL LlKE predicate would require an exact match for ” xyz”.However, the convention withregular expressions is that S need only contain a substring that is “xy “.For example, all of the followingvalues of s would yield True for the immediately preceding predicate:
yz
abcxyz123
l xyz 2 xyz 3 xyz
Note that in the last example,there are actually three occurrences of the regular expression ” x.yz” withinthe tested value.The user may wish to know the number of occurrences of a match.This can be donewith oCCURRENCES_REGEX.For example:
ocCURRENCES_REGEX( ‘ xyz’IN ‘1 xyz 2 xyz 3 xyz ‘ ) = 3
The user might also wish toknow the position of a specificmatch. This can be done usingPOSITION_REGEX.For example, to learn the starting character position of the second occurrence,
POSITION_REGEX ( ‘xyz’IN ‘l xyz 2 xyz 3 xyz’ OCCURRENCE2 ) = 9
lt is also possible to ask for the character position of the first character after the match.For example:
POSITION_REGEX ( AFTER ‘xyz’IN ‘l xyz 2 xyz 3 xyz’OCCURRENCE 2 ) = 12
If AFTER is used and the last character of the subject string is consumed, then the result is the length ofthe string plus 1 (one):
POSITION_REGEX ( AFTER ‘xyz’IN ‘ xyz’ )=4
4.4 Metacharacters and escape sequences
As mentioned,most characters can be matched by simply writing the character in the regular expression.However, certain characters are reserved as metacharacters.The complete list of metacharacters is:
. l ?* +{ ] 〔 ) l [ ]~$
The use of each of these metacharacters is explainedin subsequentSubclauses.To match a metacharacter,then an escape sequence, consisting of a backslash(” “) followed by the metacharacter is used.For
example, this expression tests whether a string contains a dollar sign:
s L工KE_REGEX’$ ”

Download infomation Go to download
PS: Some standards can't be downloaded because of some reason.

LEAVE A REPLY

Anonymous netizen Fill in information