From 014b7d2cd1ccdfca23a1f890bb1a16759bdf6aa4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 25 Apr 2019 11:40:08 +0200 Subject: data importer: multi regex management --- ishtar_common/data_importer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ishtar_common/data_importer.py') diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index baf943068..974c63e44 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1262,8 +1262,13 @@ class Importer(object): unicode(self.ERRORS['regex_not_match']) + val)) c_row.append("") return - val_group = [v.replace(NEW_LINE_BREAK, '\n') if v else '' - for v in match.groups()] + val_group = [] + for g in formater.regexp.findall(val): + if isinstance(g, (tuple, list)): + g = u"".join(g) + val_group.append( + g.replace(NEW_LINE_BREAK, '\n') if g else '' + ) else: val_group = [val] -- cgit v1.2.3