function missionIDs = GetMissionIDs(directory)
%GETMISSIONIDS Summary of this function goes here
%   Detailed explanation goes here

% Get the list of all files and folders in the specified directory
allFiles = dir(directory);

% Extract the names of all folders (excluding '.' and '..')
folderNames = {allFiles([allFiles.isdir] & ~ismember({allFiles.name}, {'.', '..'})).name};

format = {' ','.','_','999'};
idx = ~contains(folderNames,format) & contains(folderNames,'0');
filteredFolderNames = folderNames(idx);
filteredFolders = allFiles(ismember({allFiles.name},filteredFolderNames));

% % % % % Define the regular expression for the naming convention YYMSSSDD
% % % pattern = '24A03401';
% % % % pattern = '^\d{2}[A-Z]?\d{6}$'; % need it to work for 1-9 A-C
% % % % pattern = '^\d{2}[A]\d{6}$';
% % % % pattern = '[123456789][123456789][123456789ABC][0][23][49][123456789][123456789]';
% % % % pattern = '^\d{2}[1-9A-C]\d{6}$';
% % % 
% % % % Filter folder names based on the pattern
% % % filteredFolderNames = folderNames(cellfun(@(x) ~isempty(regexp(x, pattern, 'once')), folderNames));
% % % 
% % % % Get the dates of the filtered folders
% % % filteredFolders = allFiles([allFiles.isdir] & cellfun(@(x) ~isempty(regexp(x, pattern, 'once')), {allFiles.name}));

% Extract the modification dates
modDates = [filteredFolders.datenum];

% Sort the folder names by the modification dates
[~, sortedIdx] = sort(modDates, 'descend');
missionIDs = filteredFolderNames(sortedIdx);

end
