function output = textMatchesExpression(text,expression) if or( not(ischar(text)), not(ischar(expression)) ) output = false; return; end matchingResult = regexp(text,expression,'match','once'); if isempty(matchingResult) output = false; else output = true; end end