Module: Gitmoji::Regex
- Defined in:
- lib/gitmoji/regex.rb,
lib/gitmoji/regex/version.rb,
lib/gitmoji/regex/reference.rb
Overview
Namespace for the regex and maintenance tools provided by this gem.
Defined Under Namespace
Modules: Version Classes: Reference
Constant Summary collapse
- REGEX =
Regular expression that matches any official Gitmoji emoji.
You can use this to validate commit messages or extract leading gitmoji from strings.
Examples:
# Validate a commit title starts with a gitmoji (Gitmoji::Regex::REGEX =~ "✨ Add feature") #=> 0 # Extract all gitmojis from text "✨ Fix bug 🐛".scan(Gitmoji::Regex::REGEX) #=> ["✨", "🐛"]
Regexp.new("(?-mix:🎨|⚡️|🔥|🐛|🚑️|✨|📝|🚀|💄|🎉|✅|🔒️|🔐|🔖|🚨|🚧|💚|⬇️|⬆️|📌|👷|📈|♻️|➕|➖|🔧|🔨|🌐|✏️|💩|⏪️|🔀|📦️|👽️|🚚|📄|💥|🍱|♿️|💡|🍻|💬|🗃️|🔊|🔇|👥|🚸|🏗️|📱|🤡|🥚|🙈|📸|⚗️|🔍️|🏷️|🌱|🚩|🥅|💫|🗑️|🛂|🩹|🧐|⚰️|🧪|👔|🩺|🧱|🧑💻|💸|🧵|🦺|✈️)")