Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement new Concept Exercise: Regular Expressions

See original GitHub issue

Getting Started

If you have not yet contributed to concept exercises before, this task requires some upfront reading to acquire the necessary background knowledge.

Here you can read about what Concept Exercises are and how they are structured:

If you have not done so yet, it is probably also helpful to do a couple of “Learning Exercises” (this is how they are called on the site) yourself. You can also look at the code of an existing concept exercise like bird-watcher (concept for-loops) for reference.

See the documentation above (general documentation), as well as How to implement a Concept Exercise in JavaScript.

Also be aware of these general guidelines.


The goal here is to create a new concept exercise to teach regular expressions. The concept needs to be written from scratch, the exercise can be ported from another track (see details below).


The following concept needs to be created. You can use the file of the concept also as file of the exercise. No need to create different content at this point. Additionally, if you want to save some time it is ok to not have an extensive for now. It can also be mainly the content, maybe with some additions you would like to make.

  • regular-expressions

Learning Objectives

In the concepts the student should learn about the following topics and then practice them in the concept exercise.

  • which flavor of regex is used in JavaScript and any notable differences to other common implementations
  • how to create a regular expression
  • how to pass flags in both versions of creating a regular expression
  • how to use the most common regex related functions, with special focus on
    • when to use test and when to use match
    • understanding the different parts of the match result incl. capture results
  • using e.g. to help with writing/reading regex
  • being aware of performance implications

Out of Scope

Explaining how to write regular expressions themselves is out of scope for the concept here but we should link to some good resource a student could read to learn about them from scratch, maybe Eloquent JavaScript for example. We don’t do this as part of the concept because Exercism assumes the student is already fluent in another language and most languages include some form of regular expressions.


  • arrays as this is the result of match etc.
  • classes to understand the new Regex syntax

Exercise Idea

C# “Parsing Log Lines” Exercise could serve as template.

In case you port that exercise, make sure to check all tasks make sense for JavaScript and whether some additional task needs to be added to cover some JavaScript specific content.


Here some links that might be helpful as a starting point and/or for the links section of the concept:

How to proceed

  1. First accept this issue by saying “I’d like to work on this” (no need to wait for a response, just go ahead).
  2. Use this issue to discuss any questions you have, what should be included in the content and what not and to collect more reference material.
  3. Create a PR and set “exercism/javascript” as reviewers. Additionally you can write in #maintaining-javascript on Slack that your PR is ready for review. Once you incorporated any critical feedback that the reviewer might give you and the PR is approved, it will be merged by a maintainer.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

junedevcommented, Feb 2, 2022

Yes, the best way is you push your changes and create a draft PR. Then leave a comment there which part I should look at.

julendiazcommented, Jan 29, 2022

Thanks a lot @junedev for the opportunity and clarification.

Then I’ll work on the concept, focusing on how JavaScript differs in writing regex. I think I got it, I’ll start thinking about the best approach as soon as possible.

Keep you updated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[V3] Implement new Concept Exercise: regular-expressions
The goal of this exercise is to teach the student the basics of the Concept of Regular Expressions in Ruby. Learning objectives. Know...
Read more >
RegexOne - Learn Regular Expressions - Lesson 1: An ...
RegexOne provides a set of interactive lessons and exercises to help you learn regular expressions.
Read more >
13. Advanced Regular Expressions - Python Courses eu
In our introduction to regular expressions of our tutorial we have covered the basic principles of regular expressions. We have shown, how the...
Read more >
A Practical Guide to Regular Expressions (RegEx) In JavaScript
Regular expressions are a way to describe patterns in a string data . They form a small language of its own, which is...
Read more >
Regular expressions: Pulling it all together - Red Hat
In Introducing regular expressions, I introduced the concept and basics, and then in Getting started with regular expressions: An example, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found