|
7 | 7 | <link rel="stylesheet" href="checker.css"> |
8 | 8 | <script src="js-yaml.min.js"></script> |
9 | 9 | <script src="checker.js"></script> |
| 10 | +<script src="redos.js"></script> |
10 | 11 | <link rel="license" href="https://creativecommons.org/licenses/by/4.0/"> |
11 | 12 |
|
12 | 13 | <!-- See create_labs.md for how to create your own lab! --> |
|
24 | 25 | </script> |
25 | 26 |
|
26 | 27 |
|
27 | | -<script id="info" type="application/yaml"> |
28 | | ---- |
29 | | -hints: |
30 | | -- absent: ", $" |
31 | | - text: This is a parameter, it must end with a comma. |
32 | | -- absent: | |
33 | | - query \( ["'`]id["'`] \) |
34 | | - text: Use query() with an 'id' parameter. |
35 | | -- present: | |
36 | | - query \( ["'`]id["'`] \) [^. ] |
37 | | - text: After query("id") use a period to invoke a verification method. |
38 | | -- present: | |
39 | | - (islength|Islength|IsLength|ISLENGTH) |
40 | | - text: > |
41 | | - JavaScript is case-sensitive. Use isLength instead of the case you have. |
42 | | -- absent: isLength |
43 | | - text: Limit the maximum length of input strings using isLength(). |
44 | | -- present: | |
45 | | - isLength \( m |
46 | | - text: | |
47 | | - You need to pass isLength() an object with the max parameter, e.g., isLength({max: VALUE}). |
48 | | -- absent: matches |
49 | | - text: Use matches(). |
50 | | -- present: | |
51 | | - matches \( /[^^] |
52 | | - text: Match the whole string - begin the regular expression with ^ |
53 | | -- present: | |
54 | | - matches \( /.*[^$]/ |
55 | | - text: Match the whole string - end the regular expression with $ |
56 | | -- present: | |
57 | | - matches \( /.*[^$]/ |
58 | | - text: Match the whole string - end the regular expression with $ |
59 | | -- present: | |
60 | | - matches \( /\^\[A-Z\] |
61 | | - text: That would match only letters, you need digits as well. |
62 | | -- present: | |
63 | | - matches \( /\^\[a-z\] |
64 | | - text: That would match only lower case letters, the format requirement is uppercase letters. |
65 | | -- present: | |
66 | | - matches \( /\^\(\[A-Z0-9\]\+\)\+\$ |
67 | | - text: Remember to fix the regex, the outer + quantifier causes backtracking by trying to match one or more sequences of one or more uppercase alphanumeric characters. |
68 | | -- present: | |
69 | | - matches \( /\^\(\[A-Z0-9\]\+\)\$ |
70 | | - text: Remove the grouping, you don’t need the parentheses. |
71 | | -- present: \[0-9[Aa]-[Zz]\] |
72 | | - text: It's conventional to list letters first, so use [A-Z0-9] not [0-9A-Z] |
73 | | - |
74 | | -# debug: true |
75 | | -</script> |
76 | 28 | </head> |
77 | 29 | <body> |
78 | 30 | <!-- For GitHub Pages formatting: --> |
|
0 commit comments