* Use dfn tags * remove misused <dfn> tags * Revert "remove misused <dfn> tags" This reverts commit b24968a96810f618d831410ac90a0bc452ebde50. * Update curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.english.md Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Make "array" lowercase Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Fix dfn usage * Address last dfn tags
2.0 KiB
2.0 KiB
id, title, challengeType, forumTopicId
id | title | challengeType | forumTopicId |
---|---|---|---|
587d7db5367417b2b2512b96 | Match Letters of the Alphabet | 1 | 301354 |
Description
-
.
For example, to match lowercase letters a
through e
you would use [a-e]
.
let catStr = "cat";
let batStr = "bat";
let matStr = "mat";
let bgRegex = /[a-e]at/;
catStr.match(bgRegex); // Returns ["cat"]
batStr.match(bgRegex); // Returns ["bat"]
matStr.match(bgRegex); // Returns null
Instructions
quoteSample
.
NoteBe sure to match both upper- and lowercase letters.
Tests
tests:
- text: Your regex <code>alphabetRegex</code> should match 35 items.
testString: assert(result.length == 35);
- text: Your regex <code>alphabetRegex</code> should use the global flag.
testString: assert(alphabetRegex.flags.match(/g/).length == 1);
- text: Your regex <code>alphabetRegex</code> should use the case insensitive flag.
testString: assert(alphabetRegex.flags.match(/i/).length == 1);
Challenge Seed
let quoteSample = "The quick brown fox jumps over the lazy dog.";
let alphabetRegex = /change/; // Change this line
let result = alphabetRegex; // Change this line
Solution
let quoteSample = "The quick brown fox jumps over the lazy dog.";
let alphabetRegex = /[a-z]/gi; // Change this line
let result = quoteSample.match(alphabetRegex); // Change this line