question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escaped quotes test regex broken

See original GitHub issue

On 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:closed
  • Created 7 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
leontrantercommented, Nov 14, 2016

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 😦

0reactions
dhcodescommented, Aug 2, 2017

Tested on Chrome and Firefox after new updates. Both are working. Closing this issue unless it crops up again.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found