Test, validate and match regular expressions
Captures the first character of each word in group 1 and all remaining characters in group 2. Commonly used for Pig Latin transformations via a replacement like $2$1ay, which moves the leading letter to the end and appends 'ay'. The g flag applies it to every match, while m processes each line independently.