Assuming timestamps are all of the same form, you can find them with regexp:
tstamps1 = regexp(filesgroup1, '\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}', 'match', 'once');
You can do the exact same thing for group 2:
filesgroup2: a cell array of string representing file names from group 2
tstamps2 = regexp(filesgroup1, '\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}', 'match', 'once');
You can then check which timestamps from group 2 are in group 1 with ismember: isingroup1 = ismember(tstamps2, tstamps1);
Finally, you use the logical array returned by ismember to filter your group2 filenames:
files2match1 = filesgroup2(isingroup1);
Note: the regexp matches 4 digits, followed by '-', followed by 2 digits, followed by '-', followed by 2 digits, followed by 'T', followed by 2 digits, followed by '-', followed by 2 digits, followed by '-', followed by 2 digits.
Best Answer