Skip to content

Instantly share code, notes, and snippets.

@Snailedlt
Last active May 5, 2022 13:40
Show Gist options
  • Save Snailedlt/70750393a2f1bdc7cb612e54949dca12 to your computer and use it in GitHub Desktop.
Save Snailedlt/70750393a2f1bdc7cb612e54949dca12 to your computer and use it in GitHub Desktop.
Simplified version of the GitLab's regex pattern to autoclose issues with commit messages.
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?(?:(?:#\d+)|(?:#\d+))(?:(?: *,? +and +| *,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)
@Snailedlt
Copy link
Author

Snailedlt commented May 5, 2022

You can test it out here: https://regex101.com/

Based on GitLab's issue_closing_pattern found here and here, and tested here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment