firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.28k stars 199 forks source link

Feedback: Quiz feature (beta) #1076

Closed Zarthus closed 5 years ago

Zarthus commented 5 years ago

Post feedback for the quiz in here. Include browser version and OS

Zarthus commented 5 years ago

Improvements

Bugs

Difficulty Curve

Windows 10, Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)

Timvde commented 5 years ago

Regarding the bug: correct markdown is [text](url), not the other way around.

Improvements

Bugs

Typos

Arch Linux, Firefox 64 (64 bit)

firasdib commented 5 years ago

Improvements

Ouims commented 5 years ago

feedback so far: quiz 2 - test 7/8 says 'every occurence of i' or 'every I' --- I think it should go with the description and talk about 'every occurence of the word i' and there should not be a capital I there. quiz 2 - the shortest solution is without the /i flag, but without the /i flag you're going to match all of the word "I" as well which isn't as efficient, I don't know if that's a concern but it felt wrong when it told me i didn't have the shortest solution. note: this isn't about efficiency i guess.

quiz 6 - without @firasdib telling me what i should be doing i'd never have understand it's one key press generating two extra key, i'd suggest using that word 'extra' or finding better wording overall

jay-tea commented 5 years ago

I'd recommend the following fail test for task 7: "1/1/1/1"

TWiStErRob commented 5 years ago

Android Chrome and Chrome on Windows 10:

Intro:

General:

Other (unrelated to quiz, but found during)

Q1

Excellent! I guess you have some regex knowledge, so let's get started!

Q2

Let's test your knowledge

Q3

You can with regex return the number of matches.

sentence structure was strange + the it doesn't return the matches, it's not a regex feature as far as I know, but there's the API to get all the matches. Your validation script is counting the matches, not the engine, so using "return" is a bit off here. I would re-word as "count" and "match individual characters" instead of "return"

Test 5/8: You seem to be counting vowels. A gentle reminder: aeiou are vowels.

got the above for [A-Z]/g

Q4

Q4 and Q5

Q7

Each number should be at most 255.

Q8

Test 11/15: Also remove empty tags: <>.

Test 12/15: Tags can sometimes span multiple lines. For that reason you should also remove partial tags, which may be missing either < or > if they occur at the start or end of the string, respectively. For example, body>text</body

/<\s*>|<\s*([^\s>]+).*?>((.*)<\s*\/\s*\1\s*>)?|<\s*([^\s>]+).*?\/\s*>/gs actually handles whitespaces in all the places (note the s flag and the use of \s* all over), even where there shouldn't allow (e.g. </ and /> must be without space as far as I remember, maybe in XHTML, but still), here's my test that replaces as expected, yet I get the above error:

<
normal-closed
>
te
xt
<
/
normal-closed
>

<
unclosed-tag
with-attribute
>

<
wrapped-self-closed
with-attribute
/
>

... can't proceed due to this last failure.

TWiStErRob commented 5 years ago

General:

Q7

Q9

Test 16/44: The pieces of a domain must not end with a hyphen.

Test 22/44: The local-part is now allowed to end with a dot, for example, x. is not an allowed local-part.

Test 29/44: @ must not be allowed in the local-part or domain. Test 30/44: ()<>,;:\"[] must not be allowed in the local-part.

Q10

set backreferences with a, c, and -

For every occurence of the char #, backreference the previous character. Example: for the text "a#bc# -#", set backreferences with a, c and -. You are not allowed to consume the hash character.

Q11

Now I can effectively match floating point numbers in any given text document!

Q12

TWiStErRob commented 5 years ago

7cf2f44 Don't allow anything but letters in the tld - Firas Dib f8cda54 No numbers in TLD - Firas Dib

hmm, this broke my existing accepted submission; after modifying a test case, consider re-running all the submissions and flagging the failing ones on the UI?

image

Similarly when changing requirements the originally sortest solution may not work any more, and hence it would be impossible for anyone to match the shortest solution length. Do you have anything to prevent this?

firasdib commented 5 years ago

@TWiStErRob No, there is nothing to prevent this. Hopefully those cases will be very limited.

kepexx commented 5 years ago

General: The error messages are very vague, and so are the requirements. Having the actual unit tests that are done on the regex would be helpful

Q7

Only digits are valid in an IP address.

My regex doesn't match non-digits except for the dot separator.

firasdib commented 5 years ago

@FireCubez Thanks for the feedback.

The general idea for the quiz is to not give away any solutions or intricate details, and that the user has to figure out exactly what they need to do. They need to read the task carefully and listen to the error messages. It feels more like a challenge that way, otherwise it's just a regular task. The feedback you get is meant to guide you somewhat, and is more helpful in the earlier tasks than the later.

However, if some tasks have insufficient information in the task description, or some tests are unclear, these need to be addresses.

My regex doesn't match non-digits except for the dot separator.

If you get that error, I guarantee you're matching non-digits.

Zarthus commented 5 years ago
TWiStErRob commented 5 years ago

@Zarthus I expect plot (1 - 0.2)^x*100, x=0 to 28 curious to see if it's true

Zarthus commented 5 years ago

I expect img :P

firasdib commented 5 years ago

@TWiStErRob @Zarthus Both of those graphs are, quite likely, the correct approximation. Is it any useful or fun info to share? If so, where would it be placed?

Zarthus commented 5 years ago

@firasdib I'd introduce a separate menu in the very bottom with "usage statistics" to not discourage people who land in "Introduction". Perhaps gate it off to 5 quiz completions to avoid people from being discouraged right off the get go.

firasdib commented 5 years ago

@Zarthus Would that be a full page with a single graph in it?

TWiStErRob commented 5 years ago

Agree with @Zarthus + other than the graph, in the future,

knoebber commented 5 years ago

Task 9 - test 30 and 31 have same error message: "Whitespace must not be allowed in the local-part."

firasdib commented 5 years ago

@knoebber Thanks for the feedback. Multiple tests have similar/same messages, which is by design. Typically its not an oversight, but rather multiple tests trying to ensure you're not cheating in any way :-)

Cosmatevs commented 5 years ago

Task 7: It says "The addresses can only have a maximum value of 255 in either octet, and cannot have leading zeroes" but it accepts solutions that capture two- and three-digit numbers with leading zeroes, e.g. 01.001.01.001 Edit: Yeah, I meant task 7, not 8.

firasdib commented 5 years ago

@Cosmatevs Do you mean task 7? We used to require not having leading zeroes, but this complicates an early task too much, and was thus removed. I'll correct the text.

Cosmatevs commented 5 years ago

Task 20 (quoted text with escapes): Solutions that capture multi-line quotes are accepted, e.g. "quo te" In addition, surprisingly, global or multi line flags are not required.

firasdib commented 5 years ago

@Cosmatevs Since you need to match a single string in quotes, you don't need /g, as there is only one match possible. Consequently, the /m flag is unnecessary. Multi-line quotes are perfectly fine.

Ouims commented 5 years ago

On task 3, if you match non printable character, the regex is accepted, but these char are ascii, so it's very misleading to say 'ascii' in the description i think. It's especially a problem if you want to find out how to get the best score 16 char.

I think the 16 char entries should be invalid with the best score being 18.

Davidebyzero commented 5 years ago

On task 3, if you match non printable character, the regex is accepted, but these char are ascii, so it's very misleading to say 'ascii' in the description i think.

I would hold that the 16 char solution is valid, because the problem's input domain does not include nonprintable ASCII.

Ouims commented 5 years ago

yeah it does, it's possible to enter ascii char in there. I successfuly entered ascii 1, so it's possible to handle all ascii with ascii 0 being impossible to handle there.

Davidebyzero commented 5 years ago

yeah it does, it's possible to enter ascii char in there. I successfuly entered ascii 1, so it's possible to handle all ascii with ascii 0 being impossible to handle there.

This only proves that a 16 character solution is valid, even if including nonprintable ASCII as you want it to.

Most software can't have ascii 0 inside a string, due to using null-terminated strings.

Davidebyzero commented 5 years ago

Task 7: It says "The addresses can only have a maximum value of 255 in either octet, and cannot have leading zeroes" but it accepts solutions that capture two- and three-digit numbers with leading zeroes, e.g. 01.001.01.001

I don't consider that to be a problem, as an IP address with leading zeroes in some of its octets is still entirely valid. For example, 127.000.000.001 acts the same as 127.0.0.1.

Also, the problem does not say anywhere that they cannot have leading zeros. Unless you're talking about a particular "Test n/107: ..." error message you saw?

Davidebyzero commented 5 years ago

On task 23, a regex that changes ]* to ], or ]*c*d[*asdf**]a*f*[sf*f*s to ]cd[asdf]a*f*[sffs, or for that matter erases the *s between the first ] and the first [ in any string starting with ], incorrectly succeeds. I temporarily had such an invalid solution as I was golfing down my solution. (Now it's valid, and even shorter.)

firasdib commented 5 years ago

Task 7: It says "The addresses can only have a maximum value of 255 in either octet, and cannot have leading zeroes" but it accepts solutions that capture two- and three-digit numbers with leading zeroes, e.g. 01.001.01.001

I don't consider that to be a problem, as an IP address with leading zeroes in some of its octets is still entirely valid. For example, 127.000.000.001 acts the same as 127.0.0.1.

Also, the problem does not say anywhere that they cannot have leading zeros. Unless you're talking about a particular "Test n/107: ..." error message you saw?

Initially the task disallowed leading zeros. But I thought this ruined the general experience of this early task and complicated more than necessary, and decided to remove it. Some remnants of it remained, but it has been leaned up now.

On task 23, a regex that changes ] to ], or ]cd[asdf*]af[sffs to ]cd[asdf]af[sffs, or for that matter erases the s between the first ] and the first [ in any string starting with ], incorrectly succeeds. I temporarily had such an invalid solution as I was golfing down my solution. (Now it's valid, and even shorter.)

Thanks. I'll fix.

firasdib commented 5 years ago

I'm considering deleting the email task, as I do not believe it adds anything of value to the quiz, and is just "more of the same". Thoughts?

jay-tea commented 5 years ago

I'm considering deleting the email task, as I do not believe it adds anything of value to the quiz, and is just "more of the same". Thoughts?

I'd say it's one of the more interesting ones to shorten, but I'm biased :)

firasdib commented 5 years ago

I'd say it's one of the more interesting ones to shorten, but I'm biased :)

Most of the solutions allow for quite invalid input. The testing isn't far as extensive as it has to be. If I make it stricter, that'll also make it more boring.

Unsure.

knoebber commented 5 years ago

I'm considering deleting the email task, as I do not believe it adds anything of value to the quiz, and is just "more of the same". Thoughts?

I had a lot fun doing that one and learned a lot. I understand that most of our solutions are far away from recognizing all valid emails, but I still think its a valuable exercise.

firasdib commented 5 years ago

Okay, in that case I could add a few more tests to root out the obviously invalid emails, and keep the task.

Cosmatevs commented 5 years ago

Clicking the submit button should force checking if the expression has been changed. clip0018

firasdib commented 5 years ago

This issue is getting hard to track, so if you don't mind, would you please open specific issues using the new Quiz Template, so that I can get a better idea of what needs fixing?

Thanks for all the reports guys.

@Cosmatevs Great issue. Very weird though. Could you please open a new one for this?