This includes certificates (where it does nothing), but does not include any translations.
2.2 KiB
2.2 KiB
id, title, challengeType, isHidden, forumTopicId
id | title | challengeType | isHidden | forumTopicId |
---|---|---|---|---|
587d7db9367417b2b2512ba7 | Specify Exact Number of Matches | 1 | false | 301365 |
Description
"hah"
with the letter a
3
times, your regex would be /ha{3}h/
.
let A4 = "haaaah";
let A3 = "haaah";
let A100 = "h" + "a".repeat(100) + "h";
let multipleHA = /ha{3}h/;
multipleHA.test(A4); // Returns false
multipleHA.test(A3); // Returns true
multipleHA.test(A100); // Returns false
Instructions
timRegex
to match the word "Timber"
only when it has four letter m
's.
Tests
tests:
- text: Your regex should use curly brackets.
testString: assert(timRegex.source.match(/{.*?}/).length > 0);
- text: Your regex should not match <code>"Timber"</code>
testString: timRegex.lastIndex = 0; assert(!timRegex.test("Timber"));
- text: Your regex should not match <code>"Timmber"</code>
testString: timRegex.lastIndex = 0; assert(!timRegex.test("Timmber"));
- text: Your regex should not match <code>"Timmmber"</code>
testString: timRegex.lastIndex = 0; assert(!timRegex.test("Timmmber"));
- text: Your regex should match <code>"Timmmmber"</code>
testString: timRegex.lastIndex = 0; assert(timRegex.test("Timmmmber"));
- text: Your regex should not match <code>"Timber"</code> with 30 <code>m</code>'s in it.
testString: timRegex.lastIndex = 0; assert(!timRegex.test("Ti" + "m".repeat(30) + "ber"));
Challenge Seed
let timStr = "Timmmmber";
let timRegex = /change/; // Change this line
let result = timRegex.test(timStr);
Solution
let timStr = "Timmmmber";
let timRegex = /Tim{4}ber/; // Change this line
let result = timRegex.test(timStr);