From 4ca9bbe4e5c812040688a58592adacd681cf423f Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Fri, 8 Jun 2012 14:52:51 +0000 Subject: [PATCH] Handle the case when more then one value comes out of the regex. If more then one value comes out of the regex, handle that case. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@8518 57e6efec-57d4-0310-aeb1-a6c144bb1a8b --- @EMLGenerator/parse_inputs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@EMLGenerator/parse_inputs.m b/@EMLGenerator/parse_inputs.m index b02177f..a0f022e 100644 --- a/@EMLGenerator/parse_inputs.m +++ b/@EMLGenerator/parse_inputs.m @@ -42,7 +42,7 @@ for i=1:size(new_inputs,2) new_inputs{i}(1) = regexprep(new_inputs{i}(1),'\s',''); valid = regexp(new_inputs{i}(1),'[a-zA-Z][_a-zA-Z0-9]*','match'); - if isempty(char(new_inputs{i}(1))) || length(valid{1}) == 0 || ~strcmp(new_inputs{i}(1),valid{1}) + if isempty(char(new_inputs{i}(1))) || length(valid{1}(1)) == 0 || ~strcmp(new_inputs{i}(1),valid{1}(1)) new_inputs{i}(2) = {'error'}; %revised_input = cat(2,revised_input,[char(inputs{i}(1)); 'error']) end -- GitLab