Robuta

https://au.mathworks.com/help/matlab/ref/lineboundary.html lineBoundary - Match start or end of line - MATLAB This MATLAB function creates a pattern that matches the start or end of a line, including newline characters. end of linematchstartmatlab