respect-validation/docs/validators/Emoji.md
Alexandre Gomes Gaigalas bd48bdcda4 Lint Changelog format in validator docs
Introduces a Markdown linter for checking the Changelog format.

"See Also" was transformed into a section to make it easier to
handle it with the `Content` class. The "Related" linter was
simplified to reflect that change too.

An additional "alignment" parameter was added to markdown table
generators, allowing the padding and headers to be explicitly
marked with a specific left (-1), middle (0) or right(1)
alignment.

Existing files were fixed using the `fix` option after the
changes.
2026-01-26 19:11:00 +00:00

2.4 KiB
Raw Blame History

Emoji

  • Emoji()

Validates if the input is an emoji or a sequence of emojis.

v::emoji()->assert('🍕');
// Validation passes successfully

v::emoji()->assert('🎈');
// Validation passes successfully

v::emoji()->assert('⚡');
// Validation passes successfully

v::emoji()->assert('🌊🌊🌊🌊🌊🏄🌊🌊🌊🏖🌴');
// Validation passes successfully

v::emoji()->assert('🇧🇷'); // (Country flags)
// Validation passes successfully

v::emoji()->assert('👨‍👩‍👧‍👦'); // (ZWJ sequence)
// Validation passes successfully

v::emoji()->assert('👩🏽'); // (Skin tone modifier)
// Validation passes successfully

v::emoji()->assert('1⃣'); // (Keycap sequence)
// Validation passes successfully

v::emoji()->assert('Hello World');
// → "Hello World" must be an emoji

v::emoji()->assert('this is a spark ⚡'); // (Mixed content)
// → "this is a spark ⚡" must be an emoji

This validator supports:

  • Basic emojis and pictographs
  • Skin tone modifiers (Fitzpatrick scale)
  • Country flags (regional indicator sequences)
  • Subdivision flags (tag sequences like 🏴󠁧󠁢󠁥󠁮󠁧󠁿)
  • Keycap sequences (0-9, #️⃣, *️⃣)
  • ZWJ (Zero Width Joiner) sequences for families, professions, and combined emojis
  • Emojis up to Unicode 17.0 / Emoji 16.0

Templates

Emoji::TEMPLATE_STANDARD

Mode Template
default {{subject}} must be an emoji
inverted {{subject}} must not be an emoji

Template placeholders

Placeholder Description
subject The validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

Version Description
3.0.0 Renamed to Emoji, changed the behavior, and added support for more emojis
2.0.0 Created as NotEmoji

See Also