freeCodeCamp/curriculum/challenges/english/02-javascript-algorithms-an.../regular-expressions
Arthur 616d96f612 refactor: update trivial regex capture group find and replace challenge (#37768)
* refactor: replace trivial regex capture group challenge

Previous challenge could be completed without any capture groups. New
challenge requires 3 capture groups and 3 uses of the submatches in the
replacement.

resolves #17645

* test: validate at least 3 capture groups were used

Use solution from SO
(https://stackoverflow.com/questions/16046620/regex-to-count-the-number-of-capturing-groups-in-a-regex)
as suggested by @RandellDawson to count the number of capturing
groups, regardless of whether or not the regex in question solves the
broader problem.

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* refactor: more meaningful variable name

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* test: add parenthesized substring test

* test: ensure 3 uses of substring replacement

* refactor: reword instructions

* fix: minor grammar fix

Co-Authored-By: Manish Giri <manish.giri.me@gmail.com>

* refactor: elaborate wording in test
2019-12-14 16:41:47 -05:00
..
check-for-all-or-none.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
check-for-mixed-grouping-of-characters.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
extract-matches.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
find-characters-with-lazy-matching.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
find-more-than-the-first-match.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
find-one-or-more-criminals-in-a-hunt.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
ignore-case-while-matching.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-a-literal-string-with-different-possibilities.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-all-letters-and-numbers.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-all-non-numbers.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-all-numbers.english.md feat: add forumTopicId to challenge frontmatter [pre-existing] 2019-08-05 22:14:37 +05:30
match-anything-with-wildcard-period.english.md Change test method from string.test(regex) to regex.test(string) (#37458) 2019-10-23 09:32:17 -05:00
match-beginning-string-patterns.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-characters-that-occur-one-or-more-times.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-characters-that-occur-zero-or-more-times.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-ending-string-patterns.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-everything-but-letters-and-numbers.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-letters-of-the-alphabet.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-literal-strings.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-non-whitespace-characters.english.md feat: add forumTopicId to challenge frontmatter [pre-existing] 2019-08-05 22:14:37 +05:30
match-numbers-and-letters-of-the-alphabet.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
match-single-character-with-multiple-possibilities.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-single-characters-not-specified.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
match-whitespace.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
positive-and-negative-lookahead.english.md Added new test cases and corrected the solution for positive and negative lookahead for ensuring that strings beginning with numbers are not accepted (#37485) 2019-11-24 17:11:20 -05:00
remove-whitespace-from-start-and-end.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30
restrict-possible-usernames.english.md fix: added new test case to prevent invalid regex (#37769) 2019-11-25 20:25:24 -05:00
reuse-patterns-using-capture-groups.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
specify-exact-number-of-matches.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
specify-only-the-lower-number-of-matches.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
specify-upper-and-lower-number-of-matches.english.md fix: use dfn instead of code tag (#36640) 2019-10-27 12:45:37 -04:00
use-capture-groups-to-search-and-replace.english.md refactor: update trivial regex capture group find and replace challenge (#37768) 2019-12-14 16:41:47 -05:00
using-the-test-method.english.md fix(curriculum): Added forumTopicId to remaining 1200 challeng… (#36558) 2019-08-05 22:14:37 +05:30