Watch Words will recognize words in quote

AI-generated summary

Watch Words Issue with Quotes

wellbing-go is experiencing issues with Watch Words flagging posts containing specific words within quotes. They attempted to use regular expressions to avoid this but were unsuccessful. The desired outcome is to ignore the quote tags and usernames, but still flag the content within the quote.

Firepup650 clarified the requirements:

[quote="ignore this part, post:xyz, topic:abc, username:ignoreThisToo"]
Don't ignore this
[/quote]
Definitely don't ignore this

However, pfaffman and Canapin believe that achieving this with a regular expression may not be possible due to line limitations.

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?
Just like

[quote="好?, post:35, topic:197290, username:思源xi路"]
回购率蹭蹭上去。
[/quote]

When I detect “xi”, it just recognize “思源xi路”. That bothers our team a lot.
This is the regular expression I used:

(?<![a-zA-Z0-9])xi(?![a-zA-Z0-9路])

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.
:wink:

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
[/quote]
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.