diff --git a/tsg_io/readTsgIniLabview.m b/tsg_io/readTsgIniLabview.m index 251b82c6fb0e8d9a55fd16622b78e11a726e273b..f7e0d24731382a11d78a0ab2c18c74d603a61d7f 100644 --- a/tsg_io/readTsgIniLabview.m +++ b/tsg_io/readTsgIniLabview.m @@ -64,8 +64,10 @@ while ~feof(fid) % construct regex with pair cle=value % and extract value - % ------------------------------------ - regex = strcat('^\s*', clef, '\s*=\s*(.+)$'); + % use quantifier none greedy (.*?) + % remove double quote from experssion : ["]* + % --------------------------------------------------- + regex = strcat('^\s*', clef, '\s*=\s*["]*(.+?)["]*$'); match = regexp( str, regex, 'tokens'); % build tsg struct @@ -101,10 +103,10 @@ while ~feof(fid) % CNDC_LINCOEF_OFFSET=0.00000000E+0 % ------------------------------------ if ~isempty(strfind(clef, 'COEF')) - regex = strcat('^\s*', clef, '_(\w+)?\s*=\s*(.*)$'); + regex = strcat('^\s*', clef, '_(\w+)?\s*=\s*["]*(.*?)["]*$'); match = regexp( str, regex, 'tokens'); elseif ~isempty(strfind(clef, 'DEPH')) - regex = strcat('^\s*', clef, '\s*=\s*(.*)$'); + regex = strcat('^\s*', clef, '\s*=\s*["]*(.*?)["]*$'); %regex = strcat('^\s*\w*_DEPH_?\w*\s*=\s*(\w.+)$'); match = regexp( str, regex, 'tokens'); else