Escaped quotes test regex broken
See original GitHub issueOn the current staging, two challenges (“Escaping Literal Quotes in Strings” and “Quoting Strings with Single Quotes”) do not pass all tests with standard solution code.
Namely, tests asserting regex match lengths for non-escaped double quotes are failing:
code.match(/[^\\\\]\"/g).length === 2
in the former challenge and
code.match(/\"/g).length === 4
in the latter.
(Note: each of these is only one half of their respective test, and it might be beneficial in this case to split each test into two parts so users know where to look for their mistake instead of counting every quotation mark, as well as speeding up debugging if something breaks the regex again later on.)
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Regex for quoted string with escaping quotes - Stack Overflow
This is the regexp can be easily broken into three pieces. As follows: # Part 1 (['"]) # Match a closing quotation mark...
Read more >Regex for Quoted String with escapable quotes - Metal Toad
This is essentially an attempt to match any string of characters up to a closing quote, considering that we should allow people to...
Read more >Quoted String > "Double quotes" with quote escape | Regex DB
Matches a double-quoted string with double quotes escaped by a repeated quote. Test with sample data. Normal Quoted. /"((?:""|[^"])*)"/.
Read more >escape all (not-already-escaped) double-quote chars in a string
In this case, capturing group 2 (surrounding the bare double-quote) did not participate. Because all escaped characters are matched this way (including escaped...
Read more >Regex split quoted strings with escape quotes - AutoIt
this works perfectly with the vbscript.regexp object as the pattern so why not in autoit? the string # test ## 123 ## done#...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m stuck on the Quoting Strings with Single Quotes challenge. I’m 100% certain I’ve got the right answer in but it’s failing two tests (remove all the backslashes, you should have two single quotes and four double quotes). Very frustrating, can’t get past this problem 😦
Tested on Chrome and Firefox after new updates. Both are working. Closing this issue unless it crops up again.