Test, validate and match regular expressions
Matches each line of text and captures its content with leading and trailing whitespace stripped. The multiline flag makes ^ and $ anchor to line boundaries, while the lazy .*? ensures the capture group stops before trailing whitespace, grabbing only the trimmed text. Commonly used to clean up lines in text files, trim whitespace from log entries, or preprocess input data.