%% Match Boundaries of Letters and Digits
% Use alphanumericBoundary to divide text along boundaries between letters and digits and non-alphanumeric characters.

txt = "123abc .?! def456";
pat = alphanumericBoundary;

% Use replace to insert "|" characters at the matched boundaries. This operation shows where these boundaries are in the text that contains a variety of character types.

replace(txt,pat,"|")

% Copyright 2020 The MathWorks, Inc.