Regular Expressions 101

Community Patterns

GitHub and GitLab URL detection

0

Regular Expression
ECMAScript (JavaScript)

/
(github.com|gitlab.com)\/([A-Za-z0-9-_]+)\/([A-Za-z0-9-_]+)
/
gm

Description

Detects github and gitlab urls and gives back the domain (either github.com or gitlab.com) and the author + repo name

Submitted by anonymous - 5 years ago