As the instructions for TF_Find() that you linked yourself say, it uses Regular Expressions for the pattern (see the AHK command
RegExMatch for more info about this), and certain characters have special meaning and need to be escaped by preceding them with a backslash (
\) if you want to represent them as a literal character. The
+ character is one of those that needs to be escaped, so changing this line in your code as shown will result in a return value of 2:
Or if you don't want to have to bother with looking for characters that need escaping, you can use this modification to the call to TF_Find() where the
\Q and
\E will cause everything in between to be treated as literal characters:
Code: Select all
list=
(
1,17/05/22 15:49,+55 31 9443-6698
2,17/05/22 17:03,+55 22 98122-3378
2,17/05/22 16:56,+55 31 7575-6785
)
SearchText:="+55 22 98122-3378"
MsgBox % TF_Find(list, 1, 0, "\Q" SearchText "\E", 1, 0)
return