Test, validate and match regular expressions
This regex matches any sequence of exactly four characters (excluding newlines) using the capturing group (.{4}). With the global flag, it iterates through the entire string, allowing you to insert separators like commas after every four characters. Typical use cases include formatting large numbers into readable groups, splitting text into chunks, or processing data in fixed-width blocks.