Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing stuffs #3

Open
4 of 7 tasks
joelgombin opened this issue Sep 6, 2017 · 1 comment
Open
4 of 7 tasks

Missing stuffs #3

joelgombin opened this issue Sep 6, 2017 · 1 comment
Assignees

Comments

@joelgombin
Copy link

joelgombin commented Sep 6, 2017

After a quick tour, a few things I think are missing:

  • explain groups in section 5
  • introduce logical negation and logical OR (|)
  • In the last section, to the question "Come up with a regular expression which checks whether a username is valid. In order to be valid, a username must be between 6 and 16 characters in length and contain only upper or lower case (English) letters, underscores, or hyphens.", "^[a-zA-Z_-]{6,16}$" is not considered a valid answer, where I think it should be
  • In the last section, to the question "Come up with a regular expression which checks whether the entered value is a (valid) hex value. In order to be valid, a hex value must be either 3 or 6 characters in length, and can contain only numbers or the lowercase letters a-f. The value may optionally be prefixed by a '#' in which case it should be 4 or 7 characters in length.", "^#?[0-9a-f]{3}[0-9a-f]{0,3}$" is accepted as a valid answer, whereas I think it is incorrect (strings of e.g. 5 characters would be accepted).
  • In the last question, to the question "We assume that a valid web URL may begin with "http://", "https://", or neither. After this follows the domain name, which as in the case of the previous email example should consist of one or more upper or lower case letters, numbers, or hypens which are then followed by a dot, and then by another two to six characters which should be lower case letters or dots. Following that is an optional directory/file section which we simplify here to be zero or more forward slashes, upper or lower case letters, numbers, underscores, spaces, dots, or hyphens.", the provided answer "^(https?:\\/\\/)?([0-9A-z\\.-]+)\\.([a-z\\.]{2,6})[\\/ A-z0-9_\\.-]*$" is slightly different since it allows for dots in the domain part, which is not mentioned by the question.
  • lookaheads are not introduced in the course, but is used in one of the questions of the last section.
  • one thing that I very often use is capturing groups. You don't really introduce them. The email adress or url examples could be recycled to illustrate them, I think.

Pretty nice job anyway!

@jonmcalder jonmcalder self-assigned this Sep 6, 2017
jonmcalder added a commit that referenced this issue Sep 16, 2017
Username example: update question
Hex example: add more negative test cases
URL example: fix solution
@jonmcalder
Copy link
Owner

It took me a while to get back to this, but just wanted to say thanks again for the review Joel. Greatly appreciated!

All your feedback was 100% valid and on point. I've refined each of those (3) applied questions slightly based on your suggestions, and 3 out of the 4 remaining points were/are already on my to-do list. Hopefully I'll get around to those soon too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants