539
539
</t >
540
540
</section >
541
541
542
+ <section title =" Regular Expressions" anchor =" regex" >
543
+ <t >
544
+ Keywords MAY use regular expressions to express constraints, or constrain
545
+ the instance value to be a regular expression.
546
+ These regular expressions SHOULD be valid according to the
547
+ <xref target =" ecma262" >ECMA 262</xref > regular expression dialect.
548
+ </t >
549
+ <t >
550
+ Furthermore, given the high disparity in regular expression constructs support,
551
+ schema authors SHOULD limit themselves to the following regular expression
552
+ tokens:
553
+
554
+ <list >
555
+ <t >individual Unicode characters, as defined by the <xref
556
+ target =" RFC7159" >JSON specification</xref >;</t >
557
+ <t >simple character classes ([abc]), range character classes ([a-z]);</t >
558
+ <t >complemented character classes ([^abc], [^a-z]);</t >
559
+ <t >simple quantifiers: "+" (one or more), "*" (zero or more), "?" (zero or
560
+ one), and their lazy versions ("+?", "*?", "??");</t >
561
+ <t >range quantifiers: "{x}" (exactly x occurrences), "{x,y}" (at least x, at
562
+ most y, occurrences), {x,} (x occurrences or more), and their lazy
563
+ versions;</t >
564
+ <t >the beginning-of-input ("^") and end-of-input ("$") anchors;</t >
565
+ <t >simple grouping ("(...)") and alternation ("|").</t >
566
+ </list >
567
+ </t >
568
+ <t >
569
+ Finally, implementations MUST NOT take regular expressions to be
570
+ anchored, neither at the beginning nor at the end. This means, for instance,
571
+ the pattern "es" matches "expression".
572
+ </t >
573
+ </section >
574
+
542
575
<section title =" Extending JSON Schema" >
543
576
<t >
544
577
Additional schema keywords and schema vocabularies MAY be defined
@@ -1506,8 +1539,9 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1506
1539
</t >
1507
1540
<t >
1508
1541
Interoperability considerations: See Sections
1509
- <xref target =" language" format =" counter" ></xref > and
1510
- <xref target =" integers" format =" counter" ></xref > above.
1542
+ <xref target =" language" format =" counter" ></xref >,
1543
+ <xref target =" integers" format =" counter" ></xref >, and
1544
+ <xref target =" regex" format =" counter" ></xref >above.
1511
1545
</t >
1512
1546
<t >
1513
1547
Fragment identifier considerations: See Section
@@ -1549,8 +1583,9 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1549
1583
</t >
1550
1584
<t >
1551
1585
Interoperability considerations: See Sections
1552
- <xref target =" language" format =" counter" ></xref > and
1553
- <xref target =" integers" format =" counter" ></xref > above.
1586
+ <xref target =" language" format =" counter" ></xref >,
1587
+ <xref target =" integers" format =" counter" ></xref >, and
1588
+ <xref target =" regex" format =" counter" ></xref >above.
1554
1589
</t >
1555
1590
<t >
1556
1591
Fragment identifier considerations: See Section
@@ -1571,6 +1606,14 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1571
1606
&RFC6901;
1572
1607
&RFC7159;
1573
1608
&ldp;
1609
+ <reference anchor =" ecma262"
1610
+ target =" http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" >
1611
+ <front >
1612
+ <title >ECMA 262 specification</title >
1613
+ <author />
1614
+ <date />
1615
+ </front >
1616
+ </reference >
1574
1617
</references >
1575
1618
1576
1619
<references title =" Informative References" >
0 commit comments