RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Text File Parser - splits on unquoted \n - backslash escape
Expression
/^("(\\["\\]|[^"])*"|[^\n])*$/gm
Description
JavaScript match() method (or equivalent) creates an array of lines from a text file. This pattern only handles lines ending with \n, not \r\n. The Matching Examples are ready for enclosure in single quotes. Output from Matching Example 1: [0]=a " b [\n] " c [1]= Line2... [2]= Line3... Output from Matching Example 2: [0]=a " b [\r][\n]" c [\r] [1]= [2]= Line2... [\r] [3]= [4]= Line3...
Matches
a " b \n " c \n Line2... \n Line3... | a " b \r\n " c \r\n Line2... \r\n Line3...
Non-Matches
matches all
Author Rating: Not yet rated. Brian \S\s
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials