Skip to content

Files

Latest commit

48650ea · Jun 10, 2023

History

History

gitmoji-regex

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 11, 2023
Feb 11, 2023
Feb 11, 2023
Feb 11, 2023
Feb 11, 2023
Feb 11, 2023
Feb 11, 2023
Jun 10, 2023
Feb 11, 2023

@gitmoji/gitmoji-regex

NPM version NPM downloads

a gitmoji regex to for both gitmoji code and gitmoji unicode

this package is used in both @gitmoji/parser-opts and commitlint-plugin-gitmoji

emojiRegex

gitmojiCodeRegex

gitmojiUnicodeRegex

Header regex pattern test here : Regex101

module.exports = {
  headerPattern:
    /^(?::\w*:|(?:\ud83c[\udf00-\udfff])|(?:\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55])\s(?<type>\w*)(?:\((?<scope>.*)\))?!?:\s(?<subject>(?:(?!#).)*(?:(?!\s).))(?:\s\(?(?<ticket>#\d*)\)?)?$/,
  headerCorrespondence: ['type', 'scope', 'subject', 'ticket'],
};

License

MIT ® Arvin Xu