%% Negating Boundaries of Letters
% Use the ~ operator to negate letterBoundary. This matches boundaries between two characters when both are letters or neither are letters.
% Create a string that contains several different character types.  Create a pattern that matches a negated letterBoundary.

txt = "123 abc .?!";
pat = ~letterBoundary;

% Use replace to insert "|" characters to show where ~letterBoundary matches.

boundaries = replace(txt,pat,"|")

% Copyright 2020 The MathWorks, Inc.