gpt4 book ai didi

javascript - 如何检测 "stylized"文本?

转载 作者:数据小太阳 更新时间:2023-10-29 05:35:44 25 4
gpt4 key购买 nike

我想知道是否有一种方法可以检测文本是否“程式化”,如下所示:

ʇxǝʇ uʍop-ǝp!sdn

ⓣⓔⓧⓣ ⓢⓣⓨⓛⓔ

TRANSMITTING

I͇̜̦̦͇̬ͥ͆̀͠'̵̖̠͉̞͓̯̋̑̾̎̽̐ͫͣm̡̠͚̌̽̊̕͢ ̲̰̠̦̝̥̏͋̄̒ͯ̎̄̅̂͝b̷̛̻̎ͬ̚e̵͍̪̯̺̘̣̩̪̭ͨ̇̈̄̌̃̋̉͘h̶̖̮̦ͯͫ̂ͥ̍ͯ̌́͆͞i̸͙͙̖̹̳̝̭̱͗ͤ̌͢n̰͇̟̪̹̭͎͔͐̃ͧ͋ͥ̉d̵̬̰͌̆ͪ͆̔ͯͩ̈́͜ ͚͎͎̽͌̆̒ͬ̀̕y̵͇̰ͧ͊̈́͛͊̓o̤̳̍͌̉ͪ͒u̹͉̝̲̥ͮ̄͟͡

可以使用正则表达式来检测那些吗?

(另外,很抱歉,如果这些文字有一个词,我不知道它们是怎么称呼的,而且我在任何地方都找不到)

最佳答案

这些实际上是特殊字符,而不是程式化的文本,您可以像这样使用正则表达式过滤它们:

var myText = "abc ⓣⓔⓧⓣ ʇxǝʇ uʍop-ǝp!sdn";
var findSpecial = myText.replace(/[\w\s]/g, ""); // \w is for word chars (letters and numbers) and \s for space; g is for general search (all ocurrences) to replace all regular chars and leave the specials
if (findSpecial != "") {
alert("Text has special char(s): " + findSpecial);
} else {
alert("Text has no special chars.");
}

在此示例中,警报将是:文字有特殊字符:ⓣⓔⓧⓣʇǝʇʍ-ǝ!

关于javascript - 如何检测 "stylized"文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32207555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com