%% Match Behind Specified Pattern
% Create a pattern that matches behind "b" or "2".

txt = "abc 123";
pat = lookBehindBoundary("b"|"2");

% Use replace to insert "|" characters at the matched boundaries.

replace(txt,pat,"|")

% Copyright 2020 The MathWorks, Inc.