pahimar / chit-chat

Chat filter mod for Forge ModLoader
MIT License
14 stars 9 forks source link

Regex matching problem when using repeated characters #6

Open bspkrs opened 10 years ago

bspkrs commented 10 years ago

I was playing around with the filter and found that if I type "you are an a$$ hole" the filter doesn't catch it. I think it's due to the + regex operator being "greedy" and the first match for "$" actually captures both $ characters.

Just tested again... it also allows "you are an @s$ hole" through.

2013-12-12 12:07:48 [INFO] [Minecraft-Server] you are an a$$ hole 2013-12-12 12:07:48 [INFO] [Minecraft-Client] [CHAT] you are an a$$ hole 2013-12-12 12:09:36 [INFO] [ChitChat] Completely censored a message that was sent from player 'bspkrs' for using banned words: 'ass' 2013-12-12 12:09:36 [INFO] [Minecraft-Server] ** 2013-12-12 12:09:36 [INFO] [Minecraft-Client] [CHAT] Not allowed to say the following words on this server: 'ass' 2013-12-12 12:09:36 [INFO] [Minecraft-Client] [CHAT] ** 2013-12-12 12:09:47 [INFO] [Minecraft-Server] you are an @s$ hole 2013-12-12 12:09:47 [INFO] [Minecraft-Client] [CHAT] you are an @s$ hole

bspkrs commented 10 years ago

let me know if you need more info.