Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
fix(challenges): add test to check user is using \W in Regex
Browse files Browse the repository at this point in the history
Add test to make sure user is using \W and not ^\w
  • Loading branch information
RobAnthony01 authored and scissorsneedfoodtoo committed Aug 14, 2018
1 parent 16d52cb commit 296cf44
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,10 @@
"text": "Your regex should find 6 non-alphanumeric characters in <code>\"The five boxing wizards jump quickly.\"</code>.",
"testString": "assert(\"The five boxing wizards jump quickly.\".match(nonAlphabetRegex).length == 6, 'Your regex should find 6 non-alphanumeric characters in <code>\"The five boxing wizards jump quickly.\"</code>.');"
},
{
"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.');"
},
{
"text": "Your regex should find 8 non-alphanumeric characters in <code>\"Pack my box with five dozen liquor jugs.\"</code>",
"testString": "assert(\"Pack my box with five dozen liquor jugs.\".match(nonAlphabetRegex).length == 8, 'Your regex should find 8 non-alphanumeric characters in <code>\"Pack my box with five dozen liquor jugs.\"</code>');"
Expand Down Expand Up @@ -1718,4 +1722,4 @@
}
}
]
}
}

0 comments on commit 296cf44

Please sign in to comment.