Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some variations of emojis are not working with current version of emoji-regex library #108

Open
forebitt opened this issue Jul 9, 2023 · 0 comments

Comments

@forebitt
Copy link

forebitt commented Jul 9, 2023

I'm trying to build an input which only accepts alphanumeric and emoji characters. This is my implementation:

import emojiRegex from "emoji-regex";

const isValidInput = (input: string) => {
        const emojisPattern = emojiRegex();
        const alphanumPattern = /^[a-zA-Z0-9\s]+(\.app)?$/;
        const withoutEmojis = input.replace(emojisPattern, "e");
        return alphanumPattern.test(withoutEmojis);
      };

this is the emoji "🧑🏼‍❤️‍🧑🏼" I'm trying to parse, the library is supporting all other variation of this emoji, except this variation. Is there a way to fix it?
https://emojipedia.org/couple-with-heart-person-person-light-skin-tone-medium-skin-tone/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant