aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Andi Qu <[email protected]>2021-01-24 20:06:20 +0200
committerGravatar GitHub <[email protected]>2021-01-24 20:06:20 +0200
commit64596679aeed67a0bfdb645ade5065af129c8c56 (patch)
treecbd1bef0af61bc11adbc1b67005bdbbefc7e73f6
parentAdd matching for query params to all the regexes (diff)
Match both username *and* repo in the GitLab regex
-rw-r--r--bot/exts/info/code_snippets.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py
index 3f943aea8..e825ec513 100644
--- a/bot/exts/info/code_snippets.py
+++ b/bot/exts/info/code_snippets.py
@@ -26,7 +26,7 @@ GITHUB_GIST_RE = re.compile(
GITHUB_HEADERS = {'Accept': 'application/vnd.github.v3.raw'}
GITLAB_RE = re.compile(
- r'https://gitlab\.com/(?P<repo>[a-zA-Z0-9-]+?)/\-/blob/(?P<path>[^#>]+/{0,1})'
+ r'https://gitlab\.com/(?P<repo>[\w.-]+/[\w.-]+)/\-/blob/(?P<path>[^#>]+/{0,1})'
r'(\?[^#>]+)?(#L(?P<start_line>\d+)(-(?P<end_line>\d+))?)'
)