even better import csv regexes

This commit is contained in:
Devin Howard 2017-02-25 12:15:19 -08:00
parent 7840e09e5f
commit 9800cc27c6

View file

@ -29,8 +29,8 @@ const Import = {
handleCSV: function(text, parserOpts = {}) {
const self = Import
const topicsRegex = /("?Topics"?,*)([\s\S]*)/mi
const synapsesRegex = /("?Synapses"?,*)([\s\S]*)/mi
const topicsRegex = /("?Topics"?[, \t"]*)([\s\S]*)/mi
const synapsesRegex = /("?Synapses"?[, \t"]*)([\s\S]*)/mi
let topicsText = text.match(topicsRegex) || ''
if (topicsText) topicsText = topicsText[2].replace(synapsesRegex, '')
let synapsesText = text.match(synapsesRegex) || ''