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.

Breaks Regular Expressions

See original GitHub issue

Examples of valid RegExp that gets broken:

// thinks it is a text opening:
/'/
/"/
/\`/
// thinks it is a single-line comment opening:
/\//
// thinks it is a multi-line comment opening:
/\/*/

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Dec 26, 2015

@sibedge That’s not valid JSON even without the comment. You can’t use regex literals in JSON.

0reactions
sindresorhuscommented, Dec 26, 2015

No, that’s a JavaScript object literal.

JSON.parse('{name: "value"}')
//=> Uncaught SyntaxError: Unexpected token n(…)
Read more comments on GitHub >

github_iconTop Results From Across the Web

regex - Match linebreaks - \n or \r\n? - Stack Overflow
I have an app that runs on Windows and uses a multi-line MFC editor box. The editor box expects CRLF linebreaks, but I...
Read more >
Regex Tutorial - The Dot Matches (Almost) Any Character
Line Break Characters ... While support for the dot is universal among regex flavors, there are significant differences in which characters they treat...
Read more >
using line breaks - RegExr
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >
4.10. Limit the Number of Lines in Text - Regular Expressions ...
The grouping is repeated between zero and four times, since four line breaks occur in five lines of text. After the grouping, we...
Read more >
Replace Line break by BR - Regex Tester/Debugger
Regular Expression to Replace Line break by BR.
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