Hi, everyone. When I was using watch words to automatically flag a post with certain words, I found that it can flag a post whose quote have the specific words. I tried to use regular expression to avoid the situation. But do you guys have a better idea?
[quote="好？, post:35, topic:197290, username:思源xi路"]
When I detect “xi”, it just recognize “思源xi路”. That bothers our team a lot.
This is the regular expression I used:
Can we create a regular expression to avoid flagging posts in quote? Thank you!
What’s more, I hope the regular expression will recognize the quote content, not the name or the username.
I tried a lot to solve the problem, but ChatGPT seems not able to help with me. Is there anything to do with the Ruby regular expression?
Do you want people to be able to avoid your flags
I think that the regex is likely line-limited, so you won’t be able to use a regex to tell if a line is inside a quote. I could be wrong.
EDIT: I misunderstood.
You just want to avoid flagging the stuff inside of the
[quote ... ] tag, not the tag itself.
That seems like a legit feature request.
I don’t think so:
So essentially, I understand this as what it should/shouldn’t ignore:
[quote="ignore this part, post:xyz, topic:abc, username:ignoreThisToo"]
Don't ignore this
Definitely don't ignore this
Thanks. That’s exactly what I want to express.
I just don’t know how to write a regular expression to control that.
I believe pfaffman is right, and that’s not possible:
I tried myself and couldn’t achieve what you want despite valid regex, so there seems to be a limitation here.