%% Match Start and End Boundaries of Lines
% Use the "start" option for lineBoundary to match the specified endpoint of a line.
% Create a string with newline characters. Create a pattern that matches any characters between two "start" boundaries of lines.

txt = "This is line one." + newline + "Here is line two." + newline + "Last but not least.";
pat = lineBoundary("start") + wildcardPattern(1,inf) + lineBoundary("start");

% Extract the pattern.

extract(txt,pat)

% Copyright 2020 The MathWorks, Inc.