Javascript profanity match NOT replace

前端 未结 3 1368
天涯浪人
天涯浪人 2021-01-28 10:46

I am building a very basic profanity filter that I only want to apply on some fields on my application (fullName, userDescription) on the serverside

3条回答
  •  长发绾君心
    2021-01-28 11:19

    You are matching via a substring comparison. Your Regex needs to be modified to match for whole words instead

提交回复
热议问题