wildcards in the watch module and CString::WildCmp in general. #172

Open
opened 2026-10-05 04:02:32 +02:00 by adam · 0 comments
Owner

It seems I am unable to create a watch with a question mark ("?") as a literal "?". Instead the WildCmp function will (obviously) interpret it as a wildcard for a single character. Is there a way to escape "?" so it is to be interpreted as a literal "?"

I found this when attempting to watch for my name but not when it's part of a larger word:

add * *highlight *Tim
add * *highlight Tim *
add * *highlight * Tim *
add * *highlight * Tim.*
add * *highlight * Tim,*
add * *highlight * Tim;*
add * *highlight * Tim'*
add * *highlight * Tim"*
---and so on---

this is what gives me issues:

add * *highlight * Tim?*

I've tried

add * *highlight * Tim\?*

Also, as you can see, my attempts at matching for words, and not parts of words gets rather spammy. Is there an easier way to do this? (essentially to match: <any character except a-z or A-Z>word<any character except a-z or A-Z>)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/97845-wildcards-in-the-watch-module-and-cstring-wildcmp-in-general?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
It seems I am unable to create a watch with a question mark ("?") as a literal "?". Instead the WildCmp function will (obviously) interpret it as a wildcard for a single character. Is there a way to escape "?" so it is to be interpreted as a literal "?" I found this when attempting to watch for my name but not when it's part of a larger word: <pre>add * *highlight *Tim add * *highlight Tim * add * *highlight * Tim * add * *highlight * Tim.* add * *highlight * Tim,* add * *highlight * Tim;* add * *highlight * Tim'* add * *highlight * Tim"* ---and so on---</pre> this is what gives me issues: <pre>add * *highlight * Tim?*</pre> I've tried <pre>add * *highlight * Tim\?*</pre> Also, as you can see, my attempts at matching for words, and not parts of words gets rather spammy. Is there an easier way to do this? (essentially to match: &lt;any character except a-z or A-Z&gt;word&lt;any character except a-z or A-Z&gt;) ## <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/97845-wildcards-in-the-watch-module-and-cstring-wildcmp-in-general?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:9362630 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#172