Test, validate and match regular expressions
This regex captures the last character at the end of each line. The dot matches any character (except newline) before the end-of-line anchor. With the global flag, it will find all such matches throughout the text. It's commonly used for processing text files line by line or extracting line-ending characters for analysis or transformation.