Skip to content

Commit a4cf756

Browse files
justusbunsizeripath
andcommitted
Simplify regex
Co-authored-by: zeripath <[email protected]>
1 parent 3181cb7 commit a4cf756

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/references/references.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
2929
// mentionPattern matches all mentions in the form of "@user" or "@org/team"
3030
mentionPattern = regexp.MustCompile(`(?:\s|^|\(|\[)(@[0-9a-zA-Z-_]+|@[0-9a-zA-Z-_]+\/?[0-9a-zA-Z-_]+|@[0-9a-zA-Z-_][0-9a-zA-Z-_.]+\/?[0-9a-zA-Z-_.]+[0-9a-zA-Z-_])(?:\s|[:,;.?!]\s|[:,;.?!]?$|\)|\])`)
3131
// issueNumericPattern matches string that references to a numeric issue, e.g. #1287
32-
issueNumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[|Merge pull request \')([#!][0-9]+)(?:\s|$|\)|\]|[:;,.?!]\s|[:;,.?!]$)`)
32+
issueNumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[|\')([#!][0-9]+)(?:\s|$|\)|\]|[:;,.?!]\s|[:;,.?!]$)`)
3333
// issueAlphanumericPattern matches string that references to an alphanumeric issue, e.g. ABC-1234
3434
issueAlphanumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([A-Z]{1,10}-[1-9][0-9]*)(?:\s|$|\)|\]|:|\.(\s|$))`)
3535
// crossReferenceIssueNumericPattern matches string that references a numeric issue in a different repository

0 commit comments

Comments
 (0)