Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MsgBox(0,"",StrMatch("2auttioit22", "autoit", True))
- Func StrMatch($str, $match, $returnStr = False)
- If $str = "" Or $match = "" Then Return False
- Local $aStr = StringSplit($str, "", 1)
- Local $aMatch = StringSplit($match, "", 1)
- Local $aCheck[UBound($aMatch)], $isMatch = False
- For $i = 1 To $aStr[0]
- For $k = 1 To $aMatch[0]
- If $aMatch[$k] == $aStr[$i] Then
- For $j = $i To $aStr[0]
- $isMatch = False
- For $z = 1 To $aMatch[0]
- If $aMatch[$z] == $aStr[$j] Then
- $isMatch = True
- If $aCheck[$z] = False Then
- $aCheck[$z] = True
- ExitLoop
- EndIf
- EndIf
- Next
- If $isMatch = False Then ExitLoop
- Next
- $isMatch = True
- For $o = 1 To $aMatch[0]
- If $aCheck[$o] = False Then $isMatch = False
- $aCheck[$o] = False
- Next
- If $isMatch Then Return $returnStr ? StringMid($str, $i, $j - $i) : $i
- EndIf
- Next
- Next
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement