fix(challenges): fix regex in a JS challenge (#257)
This commit is contained in:
committed by
Kristofer Koishigawa
parent
d560d58631
commit
6058da3725
@ -1090,7 +1090,7 @@
|
||||
},
|
||||
{
|
||||
"text": "Your regex should use the shorthand character.",
|
||||
"testString":"assert(/\\\\W/.test(nonAlphabetRegex.source), 'Your regex should use the shorthand character to match characters which are non-alphanumeric.');"
|
||||
"testString": "assert(/\\\\W/.test(nonAlphabetRegex.source), 'Your regex should use the shorthand character to match characters which are non-alphanumeric.');"
|
||||
},
|
||||
{
|
||||
"text": "Your regex should find 8 non-alphanumeric characters in <code>\"Pack my box with five dozen liquor jugs.\"</code>",
|
||||
@ -1611,7 +1611,7 @@
|
||||
"You can specify the lower and upper number of patterns with <code>quantity specifiers</code> using curly brackets. Sometimes you only want a specific number of matches.",
|
||||
"To specify a certain number of patterns, just have that one number between the curly brackets.",
|
||||
"For example, to match only the word <code>\"hah\"</code> with the letter <code>a</code> <code>3</code> times, your regex would be <code>/ha{3}h/</code>.",
|
||||
"<blockquote>let A4 = \"haaaah\";<br>let A3 = \"haaah\";<br>let A100 = \"h\" + \"a\".repeat(100) + \"h\";<br>let multipleHA = /a{3}h/;<br>multipleHA.test(A4); // Returns false<br>multipleHA.test(A3); // Returns true<br>multipleHA.test(A100); // Returns false</blockquote>",
|
||||
"<blockquote>let A4 = \"haaaah\";<br>let A3 = \"haaah\";<br>let A100 = \"h\" + \"a\".repeat(100) + \"h\";<br>let multipleHA = /ha{3}h/;<br>multipleHA.test(A4); // Returns false<br>multipleHA.test(A3); // Returns true<br>multipleHA.test(A100); // Returns false</blockquote>",
|
||||
"<hr>",
|
||||
"Change the regex <code>timRegex</code> to match the word <code>\"Timber\"</code> only when it has four letter <code>m</code>'s."
|
||||
],
|
||||
@ -1643,7 +1643,7 @@
|
||||
},
|
||||
{
|
||||
"text":
|
||||
"Your regex should not match <code>\"Timber\"</code> with 30 <code>m</code>\\'s in it.",
|
||||
"Your regex should not match <code>\"Timber\"</code> with 30 <code>m</code>'s in it.",
|
||||
"testString":
|
||||
"assert(!timRegex.test(\"Ti\" + \"m\".repeat(30) + \"ber\"), 'Your regex should not match <code>\"Timber\"</code> with 30 <code>m</code>\\'s in it.');"
|
||||
}
|
||||
|
Reference in New Issue
Block a user