Skip to content

Implement new Concept Exercise: Regular Expressions #1506

Closed

Description

@junedev

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.

Goal

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).

Concepts

The following concept needs to be created. You can use the introduction.md file of the concept also as introduction.md 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 about.md for now. It can also be mainly the introduction.md 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. https://regex101.com/ 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.

Prerequisites

  • 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.

Resources

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.

Activity

  1. wymannmi commented on Nov 12, 2021

    @wymannmi
  2. junedev commented on Nov 12, 2021

    @junedev
    Author
  3. changed the title [-]New Concept Exercise: Regular Expressions[/-] [+]Implement new Concept Exercise: Regular Expressions[/+] on Nov 12, 2021
  4. wymannmi commented on Nov 12, 2021

    @wymannmi
  5. junedev commented on Dec 27, 2021

    @junedev
    Author
  6. junedev commented on Jan 19, 2022

    @junedev
    Author
  7. wymannmi commented on Jan 19, 2022

    @wymannmi
  8. junedev commented on Jan 19, 2022

    @junedev
    Author
  9. julzdao commented on Jan 28, 2022

    @julzdao
    Contributor

    Hi there!

    I'd like to work on this.

    This will be my first Open Source Contribution, so I might need to ask a few questions on the road. Nevertheless, I love teaching, hence it will be a pleasure to try to come up with a cool way of explaining such an important concept like regular expressions.

    I see that there is no rush on solving the issue, but I'll do my best to finish as quickly and efficient as possible.
    Please let me know if I am able to work on this.

    All the best,

    Julen.

  10. junedev commented on Jan 29, 2022

    @junedev
    MemberAuthor

    @julendiaz Thanks a lot for volunteering for this! I'll assign you shortly.

    To be sure you are not working in the wrong direction here, let me repeat that the concept here is NOT about teaching regular expressions as such. (We will have separate content for this in the future.) When you write the concept here, imagine your audience already knows how to write regex in a language with a similar regex variant.

  11. julzdao commented on Jan 29, 2022

    @julzdao
    Contributor

    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.

  12. julzdao commented on Feb 2, 2022

    @julzdao
    Contributor

    Hallo!

    I've come up with the first draft for the exercises (I think they're not bad 😅) Nevertheless, being the first time around, how can I be sure that I'm in the right direction?

    Should I make a commit with just the document of instructions.md even though the other files are empty?

    Or could I paste here in a comment the progress I've made so far?

    I just want to be sure, so I can keep going with the tests and explaining the concepts in detail.

    Julen.

  13. junedev commented on Feb 2, 2022

    @junedev
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions