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:๐ŸŽจ|โšก๏ธ|๐Ÿ”ฅ|๐Ÿ›|๐Ÿš‘๏ธ|โœจ|๐Ÿ“|๐Ÿš€|๐Ÿ’„|๐ŸŽ‰|โœ…|๐Ÿ”’๏ธ|๐Ÿ”|๐Ÿ”–|๐Ÿšจ|๐Ÿšง|๐Ÿ’š|โฌ‡๏ธ|โฌ†๏ธ|๐Ÿ“Œ|๐Ÿ‘ท|๐Ÿ“ˆ|โ™ป๏ธ|โž•|โž–|๐Ÿ”ง|๐Ÿ”จ|๐ŸŒ|โœ๏ธ|๐Ÿ’ฉ|โช๏ธ|๐Ÿ”€|๐Ÿ“ฆ๏ธ|๐Ÿ‘ฝ๏ธ|๐Ÿšš|๐Ÿ“„|๐Ÿ’ฅ|๐Ÿฑ|โ™ฟ๏ธ|๐Ÿ’ก|๐Ÿป|๐Ÿ’ฌ|๐Ÿ—ƒ๏ธ|๐Ÿ”Š|๐Ÿ”‡|๐Ÿ‘ฅ|๐Ÿšธ|๐Ÿ—๏ธ|๐Ÿ“ฑ|๐Ÿคก|๐Ÿฅš|๐Ÿ™ˆ|๐Ÿ“ธ|โš—๏ธ|๐Ÿ”๏ธ|๐Ÿท๏ธ|๐ŸŒฑ|๐Ÿšฉ|๐Ÿฅ…|๐Ÿ’ซ|๐Ÿ—‘๏ธ|๐Ÿ›‚|๐Ÿฉน|๐Ÿง|โšฐ๏ธ|๐Ÿงช|๐Ÿ‘”|๐Ÿฉบ|๐Ÿงฑ|๐Ÿง‘โ€๐Ÿ’ป|๐Ÿ’ธ|๐Ÿงต|๐Ÿฆบ|โœˆ๏ธ|๐Ÿฆ–)")
VERSION =

Traditional Constant Location

Version::VERSION