Build, test, and debug regular expressions
This regex matches positions within a number where a comma should be inserted as a thousands separator. It uses a lookbehind to ensure a preceding digit and a lookahead to find groups of exactly three digits followed by a word boundary. This pattern is commonly used for formatting large integers in text editors or code, with a replacement like ',', to improve readability. It works on contiguous digit sequences and avoids partial matches.