#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?xm)# Only include if previous char was start of string or delimiter" & @CRLF & _
"(?<=^|,)" & @CRLF & _
"(?:" & @CRLF & _
" # 1st option: empty quoted string (,'',)" & @CRLF & _
" '{2}" & @CRLF & _
" |" & @CRLF & _
" # 2nd option: nothing (,,)" & @CRLF & _
" (?:)" & @CRLF & _
" |" & @CRLF & _
" # 3rd option: all but quoted strings (,123,)" & @CRLF & _
" # (included linebreaks to allow multiline matching)" & @CRLF & _
" [^,'\r\n]+" & @CRLF & _
" |" & @CRLF & _
" # 4th option: quoted strings (,'123''321',)" & @CRLF & _
" # start pling" & @CRLF & _
" ' " & @CRLF & _
" (?:" & @CRLF & _
" # double quote" & @CRLF & _
" '{2}" & @CRLF & _
" |" & @CRLF & _
" # or anything but quotes" & @CRLF & _
" [^']+" & @CRLF & _
" # at least one occurance - greedy" & @CRLF & _
" )+" & @CRLF & _
" # end pling" & @CRLF & _
" '" & @CRLF & _
")" & @CRLF & _
"# Only include if next char is delimiter or end of string" & @CRLF & _
"(?=,|$)"
Local $sString = "12,'',',''',123" & @CRLF & _
"123,2.99,AMO024,Title,'Description, more info',,123987564"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm