(?m)applies the following effective flags to the remainder of the pattern: gm m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string
^start of line
\h*any horizontal whitespace character, repeated any number of times
edit the literal text edit (case sensitive) \d+a digit, repeated at least once
Non-Capturing Group(?:(?!^\h*edit)[\s\S])*? *?repeats the group contents below any number of times:
Negative Lookahead(?!^\h*edit) ^start of line
\h*any horizontal whitespace character, repeated any number of times
editthe literal text edit (case sensitive) \sany whitespace character
\Sany non-whitespace character
service the literal text service (case sensitive) "ALL"the literal text "ALL" (case sensitive) *?matches any number of characters from the set below:
\sany whitespace character
\Sany non-whitespace character
\Ra newline sequence
\h*any horizontal whitespace character, repeated any number of times
nextthe literal text next (case sensitive) $end of line
g modifier: global. Finds all matches instead of stopping after the first