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.

Support for newline regex

See original GitHub issue

My application needs to support csv files with either \r\n or \n linebreaks. Given that you already use input.split(newline) we could easily split using the standard linebreak regex: newline : /\r?\n/.

However it looks like currently you are overriding it to be \n. What is the reason for this? Would you be willing to support a default linebreak of /\r?\n/ so that both types of line endings are supported?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
pokolicommented, Jan 16, 2017

I’m closing it as the solution have been already explained on https://github.com/mholt/PapaParse/issues/289#issuecomment-182451591

0reactions
pokolicommented, Nov 2, 2017

@xuan9230 because the new line break character is included inside the text. So for me is a different issue and newline regex will not fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the regex to match a newline character?
Yes. Well, more specifically, typing a newline is the only way to match a newline character when entering a regexp interactively (as there...
Read more >
regex - Match linebreaks - \n or \r\n? - Stack Overflow
My thought to use the unicode newline character ( \u0085 ) wasn't successful, so: Is there a failsafe way to integrate the match...
Read more >
Regular expression syntax reference | AppCode Documentation
A brief summary of regexp syntax in AppCode plus tips and tricks. ... Matches any single character except a newline character.
Read more >
Regex Tutorial - The Dot Matches (Almost) Any Character
While support for the dot is universal among regex flavors, there are significant differences in which characters they treat as line break characters....
Read more >
JavaScript RegExp \n Metacharacter - W3Schools
The \n character matches newline characters. Browser Support. /\n/ is an ECMAScript1 (ES1) feature. ES1 (JavaScript 1997) is fully supported in all ...
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