QChatGPT/tests/repo_regexp_test.py
2023-11-10 23:01:56 +08:00

7 lines
183 B
Python

import re
repo_url = "git@github.com:RockChinQ/WebwlkrPlugin.git"
repo = re.findall(r'(?:https?://github\.com/|git@github\.com:)([^/]+/[^/]+?)(?:\.git|/|$)', repo_url)
print(repo)