From 5feabd762cdc33cd06c6d3f4238f68b0c2d714ad Mon Sep 17 00:00:00 2001 From: Ashraf Nazar Date: Tue, 11 Feb 2020 16:17:51 +0000 Subject: [PATCH] fix: Add tests to check lazy matching is applied and that the string "h1" is not matched (#38193) --- .../find-characters-with-lazy-matching.english.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.english.md index cea40c1a00..5b4cf52e63 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.english.md @@ -26,6 +26,10 @@ Fix the regex /<.*>/ to return the HTML tag <h1>< tests: - text: The result variable should be an array with <h1> in it testString: assert(result[0] == '

'); + - text: myRegex should use lazy matching + testString: assert(/\?/g.test(myRegex)); + - text: myRegex should not include the string 'h1' + testString: assert(!myRegex.source.match('h1')); ```