Support for newline regex
See original GitHub issueMy 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:
- Created 8 years ago
- Comments:18 (4 by maintainers)
Top 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 >
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 Free
Top 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
I’m closing it as the solution have been already explained on https://github.com/mholt/PapaParse/issues/289#issuecomment-182451591
@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.