jeeswg wrote:I tried to do a foolproof version, in my example above.
I think one would need to use
"\Q \E", but that could occur in the string aswel I suppose.
I'm not going to say it is fool proof, but it is the best I could come up with, you need to decide on a delimiter though, that is
d="" in this example.
beacuse I'm in that mood.
Code: Select all
d:="☕"
var1 := "str1"
var2 := "str2"
var3 := "str3"
var4:="str3"
;var4:="str3."
if d var4 d ~= "\Q" d var1 d "\E|\Q" d var2 d "\E|\Q" d var3 d "\E" ; ~= is Shorthand for RegExMatch
Msgbox, true
else
Msgbox, false
Back to the
|, for integers, maybe this,
Code: Select all
a:=0
b:=1
c:=2
d:=3
v:=1 ; compare abcd to v
if (x:=a|b|c|d)|v==x
msgbox, true
else
msgbox, false
return
Cheers