Regex101 icon indicating copy to clipboard operation
Regex101 copied to clipboard

Task 23: wrong solution accepted

Open anaisools opened this issue 6 years ago • 1 comments

Quiz Bug

DO NOT POST QUIZ SOLUTIONS!

Task

Task 23: Replace in between

Bug Description

The task accepts my solution that incorrectly changes *[*]*] into *[]].

Reproduction steps

I'll send you my regex on IRC.

Expected Outcome

Add a test that validates *[*]*] becomes *[]*] and not *[]].

Browser

Chrome 74.0.3729.169

OS

Windows 8.1

anaisools avatar Jun 19 '19 20:06 anaisools

Whereas the description says "there may be a ] when it's not between [ and ]", the test cases are tuned for something much more specific than that... they only put unbalanced ]s before all of the [...] groups, and never between them or after them.

FWIW, my solutions don't delete * from between unbalanced ] at the end, so I find it interesting that yours does.

I do think that if your solution is to be considered valid, the description of Task 23 should be updated to explain that the unbalanced ]s can only occur at the beginning.

Davidebyzero avatar Dec 24 '19 04:12 Davidebyzero