^start of line
\d{1,4}a Unicode decimal digit, repeated between 1 and 4 times
of the literal text of (case sensitive) \d{1,4}a Unicode decimal digit, repeated between 1 and 4 times
DOCUMENTSthe literal text DOCUMENTS (case sensitive) .*?any Unicode character, repeated any number of times
Positive Lookahead(?=^\d{1,4} of \d{1,4} DOCUMENTS|\Z) 1st Alternative^\d{1,4} of \d{1,4} DOCUMENTS ^start of line
\d{1,4}a Unicode decimal digit, repeated between 1 and 4 times
of the literal text of (case sensitive) \d{1,4}a Unicode decimal digit, repeated between 1 and 4 times
DOCUMENTSthe literal text DOCUMENTS (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
s modifier: single line. Allows a dot to match line terminators