clear; clc;

str = {'Madrid, Spain', 'Romeo and Juliet', 'MATLAB is great'};
capPattern = '[A-Z]';
spsPattern = '\s';

capStartIndex = regexp(str, capPattern, 'match')
% spaceStartIndex = regexp(str, spsPattern)