From 950cb4cb1fd08c411141d69b8755020743c7c47d Mon Sep 17 00:00:00 2001 From: Derek DeJonghe Date: Mon, 16 Dec 2019 16:48:34 -0500 Subject: [PATCH] fix regex --- semver/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/semver/__init__.py b/semver/__init__.py index 37d34ab..c654210 100644 --- a/semver/__init__.py +++ b/semver/__init__.py @@ -65,9 +65,9 @@ class SemVer(object): print('Merged branch is ' + self.merged_branch) merged_prefix = None - matches = re.findall("[\/][^\/]+[\/]", self.merged_branch) - if len(matches) > 1: - merged_prefix = matches[0][1:-1] + matches = re.findall("[^\/]*/", self.merged_branch) + if len(matches) >= 1: + merged_prefix = matches[-1][0:-1] if merged_prefix: for prefix in self.major_branches: