; English forum: http://purebasic.myforums.net/viewtopic.php?t=8578&highlight= ; Author: Johan_Haegg ; Date: 05. December 2003 Procedure WCString(pattern.s, string.s, sens.b) spos = 0 If sens.b = 0 pattern.s = UCase(pattern.s) string.s = UCase(string.s) EndIf If Left(pattern.s, 1) = "*" pos = FindString(pattern.s, "*", 2) Debug Mid(pattern.s, 2, pos - 2) spos = FindString(string, Mid(pattern.s, 2, pos - 2), spos) If spos = 0 ProcedureReturn 0 EndIf Else pos = FindString(pattern.s, "*", 1) - 1 If Left(string.s, pos) = Left(pattern.s, pos) spos = pos + 1 pos + 1 EndIf If spos = 0 ProcedureReturn 0 EndIf EndIf Repeat opos = pos + 1 pos = FindString(pattern.s, "*", opos) If pos = 0 Break EndIf spos = FindString(string, Mid(pattern.s, opos, pos-opos), spos) If spos = 0 ProcedureReturn 0 EndIf ForEver ProcedureReturn 1 EndProcedure WCString("*like*cookie*", "I like those cookies", 0) ; <- 1 WCString("*like*cookie*", "I Like those cookies", 1) ; <- 0 WCString("like*cookie*", "I like those cookies", 0) ; <- 0 WCString("like*cookie*", "like those cookies", 0) ; <- 1 ; ExecutableFormat= ; EOF