respect-validation/docs/rules/NotEmoji.md
2024-12-09 01:34:50 +01:00

1.6 KiB

NotEmoji

  • v::notEmoji()

Validates if the input does not contain an emoji.

v::notEmoji()->isValid('Hello World, without emoji'); // true
v::notEmoji()->isValid('🍕'); // false
v::notEmoji()->isValid('🎈'); // false
v::notEmoji()->isValid('⚡'); // false
v::notEmoji()->isValid('this is a spark ⚡'); // false
v::notEmoji()->isValid('🌊🌊🌊🌊🌊🏄🌊🌊🌊🏖🌴'); // false

Please consider that the performance of this validator is linear which means the longer the text the longer it takes to perform the check. However, the validator will break the execution as soon as it finds the first emoji or until it checks the whole text.

Note: this validator will check the Emoji as they are defined in Unicode V11 check the following link for more details Unicode v11

Templates

NotEmoji::TEMPLATE_STANDARD

Mode Template
default {{name}} must not contain an emoji
inverted {{name}} must contain an emoji

Template placeholders

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

Categorization

  • Strings

Changelog

Version Description
2.0.0 Created

See also: