diff --git a/docs/labs/regex1.html b/docs/labs/regex1.html index 1350ed96..f66491e4 100644 --- a/docs/labs/regex1.html +++ b/docs/labs/regex1.html @@ -12,84 +12,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/labs/regex1.js b/docs/labs/regex1.js index 4ff53da5..13bbf51f 100644 --- a/docs/labs/regex1.js +++ b/docs/labs/regex1.js @@ -162,6 +162,27 @@ info = text: "In this case we are only matching one letter, not many of them. Do not use \"*\" or \"+\" after [A-Z]." } ], + expected: [ + '^[YN]$', + '^[A-Z]+$', + '^(true|false)$', + String.raw`^[A-Z]+\Z`, + String.raw`\A[A-Z]-[0-9]+\z`, + ], + correct: [ + String.raw`\^( + \[YN\]|\[NY\]| + \( (\?\:)? Y\|N \)| + \( (\?\:)? N\|Y \) )\$`, + String.raw`\^ \[A-Z\](\+|\[A-Z\]\*) \$`, + String.raw`\^\( (\?\:)? + (true\|false|false\|true)\)\$`, + // Python uses \Z + String.raw`\^ \[A-Z\] (\+|\[A-Z\]\*) \\Z`, + // Ruby uses \A and \z + String.raw`\\A \[A-Z\]-(\[0-9\]|\\d) + (\+|(\[0-9\]|\\d)\*) \\z`, + ], preprocessing: [ [ "\\s*",