pooley182/emoji-regex-pattern
Composer 安装命令:
composer require pooley182/emoji-regex-pattern
包简介
PHP regexp pattern matching Unicode emojis
README 文档
README
This package for PHP builds a regex pattern that will match any emojis as defined by the Unicode consortium. It's especially useful when validating user submitted data if you want to remove emojis to sanitise your data.
versioning
This package does not follow typical symantic versioning rules. Typical version numbering would follow the convention X.Y.Z where X is a major version which denotes breaking changes in the package, Y would be a minor version that introduces new features but doesn't break anything, and Z would be a patch version that fixes up some code without any major changes or new features.
The version numbers of this package follow the versioning numbers of the Unicode Consortiums Emojis. V14.0 of this package will match all emojis within the consortiums V14.0 Emoji set. V15.0 of this package matches the consortiums V15.0 set of emojis. etc.
Therefore we recommend installing this package with composer require pooley182/emoji-regex-pattern ">=14.0.2", this will mean that as new emoji character sets are released your composer package will be updated to match them.
How to use
Install
composer require pooley182/emoji-regex-pattern ">=14.0.2"
Usage
use Pooley182\EmojiRegexPattern\EmojiRegexPattern; private function hasEmojis($string) { $emojiRegexPattern = '/'.EmojiRegexPattern::getEmojiPattern().'/u'; preg_match($emojiRegexPattern, $string, $matches); return !empty($matches); }
统计信息
- 总下载量: 6.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-25