Convert camel case to snake case



    Python public recipes

    The code replaces all of the metacharacters found in the string with the underscore character.

    import re
    re.sub(r'(?<!^)(?=[A-Z])', '_', your_string).lower()
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.