Test, validate and match regular expressions
Matches leading spaces at the beginning of each line, capturing them in group 1, but only when followed by a non-whitespace character—so blank or whitespace-only lines are skipped. The multiline flag makes ^ anchor to every line start, and the lookahead (?=\S) ensures the line has actual content after the indentation. Typically used to measure indentation depth via the captured group's length, detect indentation style, or convert spaces to tabs.