Test, validate and match regular expressions
Matches the zero-width position at the beginning of each line in multiline text. The 'm' flag makes '^' anchor to the start of every line (after each newline) rather than only the start of the string, while 'g' finds all occurrences. Commonly used in replace operations to prepend prefixes, line numbers, or bullet points, or combined with other patterns to validate each line of multi-line input.