function setFileExtension(h,item,value)

%   Copyright 2014-2020 The MathWorks, Inc.
value = convertStringsToChars(value);

value = strtrim( value );
matches = regexp( value, '^\.([^\\/\:\*\?\"\<\>\| \s]+)', 'match' );
if ~isempty( value ) && ~isequal( { value }, matches )
    error( message( 'coder_compile:toolchain:InvalidFileExtensionFormat', item, value ) );
end
buildItem = h.FileExtensions.getValue( item );
buildItem.setValue( value );
end
