Fix test and clarify description for reuse patterns using capture groups

pull/15515/head
Daksh Shah 2017-06-24 18:53:42 +03:00
parent c0fa27537c
commit b53600e1ab
1 changed files with 2 additions and 2 deletions

View File

@ -910,7 +910,7 @@
"<blockquote>let repeatStr = \"regex regex\";<br>let repeatRegex = /(\\w+)\\s\\1/;<br>repeatRegex.test(repeatStr); // Returns true<br>repeatStr.match(repeatRegex); // Returns [\"regex regex\", \"regex\"]</blockquote>",
"Using the <code>.match()</code> method on a string will return an array with the string it matches, along with its capture group.",
"<hr>",
"Use <code>capture groups</code> in <code>reRegex</code> to match numbers that appear three times in a string each separated by a space."
"Use <code>capture groups</code> in <code>reRegex</code> to match numbers that are repeated only three times in a string, each separated by a space."
],
"challengeSeed": [
"let repeatNum = \"42 42 42\";",
@ -923,7 +923,7 @@
"assert(reRegex.source.match(/\\\\s/g).length === 2, 'message: Your regex should have two spaces separating the three numbers.');",
"assert(reRegex.test(\"42 42 42\"), 'message: Your regex should match <code>\"42 42 42\"</code>.');",
"assert(reRegex.test(\"100 100 100\"), 'message: Your regex should match <code>\"100 100 100\"</code>.');",
"assert.equal((\"42 42 42 42\").match(reRegex.source)[0], (\"42 42 42\"), 'message: Your regex should not match <code>\"42 42 42 42\"</code>.');",
"assert.equal((\"42 42 42 42\").match(reRegex.source), null, 'message: Your regex should not match <code>\"42 42 42 42\"</code>.');",
"assert.equal((\"42 42\").match(reRegex.source), null, 'message: Your regex should not match <code>\"42 42\"</code>.');",
"assert(!reRegex.test(\"101 102 103\"), 'message: Your regex should not match <code>\"101 102 103\"</code>.');",
"assert(!reRegex.test(\"1 2 3\"), 'message: Your regex should not match <code>\"1 2 3\"</code>.');",