Skip to content

Commit 77bee85

Browse files
Merge pull request #750 from ossf/regex0_mv_answers
Move regex0 lab answers
2 parents ec1a135 + 6d068fc commit 77bee85

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

docs/labs/regex0.html

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@
1212

1313
<!-- See create_labs.md for how to create your own lab! -->
1414

15-
<!-- Sample expected answer -->
16-
<script id="expected0" type="plain/text">cat</script>
17-
18-
<!-- Full pattern of correct answer -->
19-
<script id="correct0" type="plain/text">cat</script>
20-
21-
<!-- Sample expected answer -->
22-
<script id="expected1" type="plain/text">A+BB*</script>
23-
24-
<!-- Full pattern of correct answer -->
25-
<script id="correct1" type="plain/text">
26-
A(\+|A\*)
27-
B(\+|B\*)
28-
</script>
29-
3015
</head>
3116
<body>
3217
<!-- For GitHub Pages formatting: -->

docs/labs/regex0.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ info =
4848
text: "Use \"B+\" to indicate \"one or more B\". You could also write \"BB*\"."
4949
}
5050
],
51+
expected: [
52+
'cat',
53+
'A+BB*'
54+
],
55+
correct: [
56+
'cat',
57+
// Spaces are removed by the preprocessor for this lab.
58+
String.raw`A(\+|A\*) B(\+|B\*)`
59+
],
60+
successes: [
61+
[ 'cat', 'A+B+' ],
62+
[ 'cat', 'AA*BB*' ],
63+
],
64+
failures: [
65+
[ 'Cat', 'A+B+' ],
66+
[ 'cat', 'A*B*' ],
67+
],
5168
preprocessing: [
5269
[
5370
"\\s*",

0 commit comments

Comments
 (0)