Not even counting the numerous cases of white spaces[1], combining characters, non-breaking space, figure space, soft hyphens or zero-width joiners.
This sounds difficult enough in latin script, almost impossible to capture all cases in non LTR, non-latin grapheme based texts.