Skip to content

Commit 54f5ee5

Browse files
committed
patterns.py: add github_username pattern
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent 9f7a2b1 commit 54f5ee5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/patchtest2/patterns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
mbox_bugzilla_validation = pyparsing.Regex("\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]")
5757
mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
5858
mbox_shortlog_maxlength = 90
59+
# based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript
60+
mbox_github_username = pyparsing.Regex('\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))')
5961

6062
# patch
6163

0 commit comments

Comments
 (0)