From b97c2184c0ea80cd8cbc545acde3926964e3107d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Thu, 1 Jun 2023 10:37:48 +0200 Subject: [PATCH] decamelize: ignore numeric characters --- humps/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/humps/main.py b/humps/main.py index 8e9a438..241bc76 100644 --- a/humps/main.py +++ b/humps/main.py @@ -7,7 +7,7 @@ ACRONYM_RE = re.compile(r"([A-Z\d]+)(?=[A-Z\d]|$)") PASCAL_RE = re.compile(r"([^\-_]+)") -SPLIT_RE = re.compile(r"([\-_]*[A-Z][^A-Z]*[\-_]*)") +SPLIT_RE = re.compile(r"[^0-9]([\-_]*[A-Z][^A-Z]*[\-_]*)") UNDERSCORE_RE = re.compile(r"(?<=[^\-_])[\-_]+[^\-_]")