Javascript 一些表情符号不';与我的表情符号正则表达式不匹配

Javascript 一些表情符号不';与我的表情符号正则表达式不匹配,javascript,regex,emoji,Javascript,Regex,Emoji,我正在建立一个聊天室,我想在只包含表情符号时增加文本的字体大小 所以,我们有一个匹配所有表情的正则表达式。 我在JS函数中移动了它,但在我的函数中有一些函数不返回true(即使它们在上面的正则表达式链接中匹配) var emojiRanges=[ “\u00a9 |\u00ae |[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]”, ' ', ].join(“|”) 函数isEm

我正在建立一个聊天室,我想在只包含表情符号时增加文本的字体大小

所以,我们有一个匹配所有表情的正则表达式。

我在JS函数中移动了它,但在我的函数中有一些函数不返回
true
(即使它们在上面的正则表达式链接中匹配)

var emojiRanges=[
“\u00a9 |\u00ae |[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]”,
' ',
].join(“|”)
函数isEmojiOnly(文本){
text=text.replace(新的RegExp(emojiRanges,'g'),'')
返回text.length==0
}

log(isEmojiOnly)(“这是一个稍大的正则表达式,但应该只匹配表情符号或空格

var emojiRx=new RegExp(
目前,在本周的以下几?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb\u25fc]\ufe0f?|[\u25fd\u25fe]|[\u2600-\u2604\u260e\u2611]\ufe0f|[U29614\\U2 614\\U2 614\U2 614\\\U2 614\\\U2 614\\\U2 614\\\U2 614\4\\\u2 614\U2 614\U2 614\4\U2 614\u2 614\4\u2 614\\\u2 614\\4\\\\\\\u2 614\\4\4\\4\\\\\\u2\\4\u音音除了除了除了除了除了除了除了除了除了除了除了除了除了除了上述上述上述4\\\\\\\\\\\\\\\\\\u2\u音音音[[4 614 614 614\4\4\4\4\4\\4\4\\4\4\4\4\4\4\4\4\4\4\4\4\4\4\4\4\4\\4\4\\124;[\ u2694-\u2697\u2699\u269b\u269c\u26a0]\ufe0f?|[\u26a1\u26aa\u26ab]|[\u26b0\u26b1]\ufe0f|[U2\6\U2 66B D\U2 6B D\U2 6B D\U2 6D\U2 6D\U2 6D\U2 6C124;[[\U2 666 6 6 6 6 6 6\U2 6B D\U2 6B D\U2 6D\U2 6D\U2 6B 6D\U2 6D\[[[[[[[[[6\U2 6D\u2 6D\6 6D D D\U2 6D\U2 6D D\U2 6D D D\U2 6D D\U2 6D\U2 6D\U2 6D\U2 6D D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6D\U2 6|\ ud83c[\udffb-\udfff](?:\u200d[\u2640\u2642]\ufe0f?)|\ufe0f(?:\u200d[\u2640\u2642]\ufe0f?)|[\u26fa\u26fd]|\(2)U70A\U702\UU702\UFE02\U702\uff基金??????????\u2702\U702\U702\U702\U702\U702\U702\U702\U702\U702\U702\U702\u702\U702\u702\u702\U702\U702\u702\U702\U702\U702\U702\U702\U702\U702\U702\U702\U702\U702\u702\U702\U702\U702\U702\U70A\U702-702\U702\U702\U702\U702\U702\U702\U702\U702\U702-702\U702\U702\U702-70\ u2753-\u2755\u2757]|[\u2763\u2764]\ufe0f?|[\u2795-\u2797]|\u27a1\ufe0f?|[\u27b0\u27bf]|(2\u293\u293\u293 4\u293 4\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u294\u294\u293\u294\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u293\u音音音音音音音4\u4\u3\u4\u3\u3\u音音音音音音4\u9\u3\u3\u3 3\u3\u3\u293\u3\u293\u3\u3\u3\u音音音音音音音4\u3\u3\u3\DFF]|\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\udde8\udde8\udde8\udde8\udde8\udde8\udde8\udde8\udde5\uddf5\uddf5\uddf7\uddf7\uddf7\uddf7\udde7\udde8\udde8\udde8\udde8\udde8\udde8\udde8\udde8\udde7\udde5\uddf5\uddf5\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\udUDDEE\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\udded\ud83c(\\\\uddf0\\\\uddf0\\\uddf0\\\uddf0\\\uddf0\\\\uddf0\\uddf0\\uddf0\\\uddf0\\uddf0\\\uddf0\\uddf0\uddf0\uddf0\uddf0\uddf3\uddf3\uddf7\uddf7\uddf7\uddf7\uddf1\407\407\\407\1244\1244\1244\1244\1244\1244\1244\1244\1244\1244\1244\1244\|;;\\\\\1244\\1244\\1244\1244\\\\|中国国家数据dedede3\\\\uddedede3\\\\\\3\udde3\\|\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\uddf3\ud83c4\uddf5\uddf7\uddf7\uddf7\uddf7\uddf4\uddf5\uddf5\uddf7\uddf7\uddf7\uddf7\uddf7\uddf7\uddf6\10\\\\\10 10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\4\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\uddf9\ud83c4\uddf7\uddf7\uddf9\uddf7\uddf9\uddf7\uddf7\uddf9\uddf7\uddf7\uddf9\uddf7\UDDF6\\\\\\\\\\\\\\10 10 10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\7\10\10\10\10\10\10\10\10\10\10\10\10\10\10\uddf7\10\10\10\10\10\10\uddf7\10\10\10\10\10\10\10\10\10\10\10\10\10\10\uddf7\uddf7\uddf7\uddf7\10\10\10\10\udDF;\ uddff\ud83c[\udde6\uddf2\uddfc]|\ude01 |\ude02\ufe0f?|[\ude1a\ude2f\ude32-\ude36]|\“udf21\udf24-\udf24-\udf24-\udf24\udf24\udf24\udf24\udf21\udf21\udf21\UDF27\UDF27\ufe0f\\UFF基金会????124;[\\ud37\ud37\ud37\ud37\ude37\ude37\ude37\ude37\ude37\ude37\ude37\ude37\ude0 0 0 0\试图试图试图试图试图试图试图试图试图作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为任何一个试图试图试图试图试图试图作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为\udf9f]\ufe0f?|[\udfa0-\udfc1]|\udfc2(?:\ud83c[\udffb-\udfff])?|[\udfc3\udfc4](?:\u200d[\u2640\u2642]\“ufe0f基金会”第124????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????]\ ufe0f?|\ud83c[\udffb-\udfff](?:\u200d[\u2640\u2642]\ufe0f?)\ufe0f(?:\u200d[\u2640\u2642]\“ufe0f基金会是否会出现UFF?”?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????udc63\udb40\udc74 |\udc77\udb40\udc6c\udb40\udc73)\udb40\udc7f);[\udff5\udff7]\ufe0f|4月18日(以下:u200d\ud83d\ud83d\ud83d\ud83e\UDD83E\uddba\UDD8\udff8-\udff8-\udff8-\UDFF4-\UDFF4-\UDFF4-\udff8-\UDFF4-\UDFF4-\udfff(以下\\UDFF4-\\UDFF4-\4-\1244-\udc15-\udc15-\udc15-\udc15-\udc15-\udc15-\udc15-\udc15:\udc15(以下以下以下以下以下以下以下以下以下以下以下以下以下以下以下以下任何人?\UDC8-\UDC8-\UDC8-\UDC8-\UDC8-\UDC8\UDD8\UDD8\UDD10\UDD10\uddba\UDD10\uddba????\uddba???6-\udc50](?:\ud83c[\udffb-\udfff])?[\udc51-\udc65]。[\udc66\udc67](?:\ud83c[\udffb-\udfff])?\udc68(以下简称:::)U2 00D(以下以下简称::::::\ U2 00D:(以下以下简称:::)U2 00D:\ U2 00D\U2 00D\U2 00D\U2 00D\U2 00D\U2 00D\U2 00D以下以下以下以下以下以下以下以下简称::\ U2 00D::::\ U2 00D:\以下以下以下以下以下以下以下::::::::\ Uudc6???\ Udc6????\ udc6??\\\udc6??????\ udc6???\\\udc6???\\\udc6???????\\\\udc6????\\\\\udc6???\\\\\\\ud6??????????\\\\\udc6???????\\udc66)?|\udc67(?:\u200d\ud83d[\udc66\udc67]))|(2)ud83e[\uddaf-\uddb3\uddb3\uddb3\uddbc\uddb3\uddbc\uddbc\uddbd)4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4\udb b b\udb b b b b\udb 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4)4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4;;ud83c;UDD 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 u200d(?:[\u2695\u2696\u2708]\ufe0f?|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\udd2c\ud80\ud92]|\ud83e(?:\udd1d\u200d\ud83d\udc68\ud83c\udffb |[\uddaf-\uddb3\uddbc\uddbd]))?\udffd(?:\u200d:[\u2695\u2695\u269u2708\u283]\u283