diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.english.md index 06ef8a8d7e..a2fb37b9a3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.english.md @@ -8,7 +8,7 @@ challengeType: 1
Sometimes you won't (or don't need to) know the exact characters in your patterns. Thinking of all words that match, say, a misspelling would take a long time. Luckily, you can save time using the wildcard character: . The wildcard character . will match any one character. The wildcard is also called dot and period. You can use the wildcard character just like any other character in the regex. For example, if you wanted to match "hug", "huh", "hut", and "hum", you can use the regex /hu./ to match all four words. -
let humStr = "I'll hum a song";
let hugStr = "Bear hug";
let huRegex = /hu./;
humStr.match(huRegex); // Returns ["hum"]
hugStr.match(huRegex); // Returns ["hug"]
+
let humStr = "I'll hum a song";
let hugStr = "Bear hug";
let huRegex = /hu./;
humStr.test(huRegex); // Returns true
hugStr.test(huRegex); // Returns true
## Instructions