
Played around a bit and tryed MC_8's filter from more tools, which dose the same thing you gave me. However, its not returning the number of matches[08:47:57] <Me> .tcl string match {\\*\\? *?} *!*@two*.many?.wild*.car?ds.fr
[08:47:57] <Bot> Tcl: 0
[08:48:13] <Me> .tcl string match "\\*\\? *?" "*!*@two*.many?.wild*.car?ds.fr"
[08:48:13] <Bot> Tcl: 0
[08:48:27] <Me> .tcl regexp -all -- "\\*\\? *?" "*!*@two*.many?.wild*.car?ds.fr"
[08:48:27] <Bot> Tcl: 0
[08:48:37] <Me> .tcl regexp -all -- {(\\*\\?|*?)} "*!*@two*.many?.wild*.car?ds.fr"
[08:48:37] <Bot> Tcl error: couldn't compile regular expression pattern: quantifier operand invalid
[08:48:56] <Me> .tcl string match "\\*\\? *?" "*"
[08:48:56] <Bot> Tcl: 0
[08:48:58] <Me> .tcl string match "\\*\\? *?" "*?"
[08:48:58] <Bot> Tcl: 0
[08:48:59] <Me> .tcl string match "\\*\\? *?" "* ?"
[08:48:59] <Bot> Tcl: 0
[08:49:02] <Me> .tcl string match "\\*\\? *?" "?"
[08:49:02] <Bot> Tcl: 0
[08:49:18] <Me> .tcl regexp -all -- {(\\*|\\?)} "*!*@two*.many?.wild*.car?ds.fr"
[08:49:18] <Bot> Tcl: 30
[08:49:27] <Me> .tcl regexp -all -- {(\\*|\\?)} "*!*@*.fr"
[08:49:27] <Bot> Tcl: 8
[09:55:04] <Me> .tcl set wd_fil1 [filter -regexp "?"]
[09:55:04] <bot> Tcl: \?
[09:55:08] <Me> .tcl set wd_fil2 [filter -regexp "*"]
[09:55:08] <bot> Tcl: \*
[09:55:26] <Me> .tcl regexp -all -- {[$wd_fil2]} "*!*@*.fr"
[09:55:26] <bot> Tcl: 1
[09:56:39] <Me> .tcl regexp -all -- {([$wd_fil1]|[$wd_fil2])} "*!*@*.fr ?"
[09:56:39] <bot> Tcl: 1
[09:56:41] <Me> .tcl regexp -all -- {([$wd_fil1]|[$wd_fil2])} "*!*@*.fr ? *"
[09:56:41] <bot> Tcl: 1
Code: Select all
string match "*\\**\\?*" $string
Edit: If you want to count the number of '*' and '?' in a string then you should use [regexp] (it's not possible with [string match]). For example% string match "*\\**\\?*" *!*@two*.many?.wild*.car?ds.fr
1
Code: Select all
regexp -all {\?} $string ; # returns number of '?' in string
regexp -all {\*} $string ; # returns number of '*' in string