title: Filter all patterns matching regex as a separate row in RDD in PySpark
body: <p>I have a .csv file that has records written as a single line instead of separate rows. I was able to match the pattern of each row using the regex <code>(?:"([a-zA-Z0-9 /\-\:\.\,]+)",|\\N,|"",|""){26}</code>. </p>
  
  <p>I have the following code that reads the .csv file and specifies the pattern using <code>re</code>.</p>
  
  <pre><code>textFile = sc.textFile("/home/Stores.csv")
  import re
  pattern = re.compile('(?:"([a-zA-Z0-9 /\-\:\.\,]+)",|\\N,|"",|""){26}')
  </code></pre>
  
  <p>Is it possible to do something like the code below to split the .csv file into separate rows?.</p>
  
  <pre><code>textFile.flatMap(lambda x: pattern.split(x)).collect()
  </code></pre>
  
  <p>The above code does not work. Please help me to split the single row into multiple rows with the pattern using PySpark.</p>