Build, test, and debug regular expressions
This regex matches the boundaries in camelCase or PascalCase identifiers where an underscore should be inserted to convert them to snake_case. It targets uppercase letters or digits that follow a lowercase letter, as well as uppercase letters that precede a lowercase letter (handling acronyms). It is useful for preprocessing code identifiers, generating snake_case file names, or normalizing naming conventions. The pattern is designed for Python's re module with global and multiline flags.