(?s)applies the following effective flags to the remainder of the pattern: gms s modifier: single line. Allows a dot to match line terminators
Positive Lookbehind(?<=BeginB) BeginBthe literal text BeginB (case sensitive) \s+a Unicode whitespace character, repeated at least once
Elementthe literal text Element (case sensitive) \s+a Unicode whitespace character, repeated at least once
\d+a Unicode decimal digit, repeated at least once
\s+a Unicode whitespace character, repeated at least once
\d+a Unicode decimal digit, repeated at least once
.*?any Unicode character, repeated any number of times
Positive Lookahead(?=EndB) EndBthe literal text EndB (case sensitive) g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string