Question

Replace semicolon in quotes

  • 30 December 2022
  • 1 reply
  • 22 views

Badge

I need to parse CSV file which is semicolon delimited in Nintex workflows. The lines will be splitted by ; which is not an issue.

However, there are escaped semicolons - that means they are wrapped in quotes example:

column1;column2;"column3; stillcolumn 3";column4

I have a regex which can find a match - but it will find only 1 match. How to force Nintex to get/replace all occurrences?

Regex:

("[^";]*);([^"]*";)

In .NET it is Regex.Matches, in JS there is an option /g but I do not know about any option in Nintex (except running this regex in a loop).


1 reply

Userlevel 5
Badge +10

Try this regular expression:

 

(?m);(?=[^"]*"(?:[^"\r\n]*"[^"]*")*[^"\r\n]*$)

Reply