Skip to content
Snippets Groups Projects
Commit 8d4c5a2d authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

Format .ini change with version SODA 1.1

1.0 PLATFORM_NAME=Nuka Arctica
1.1 PLATFORM_NAME = "Nuka Arctica"
Modify regexp that works in all versions
use quantifier none greedy (.*?)
remove double quote from experssion : ["]*
parent e89484bc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment