kiboost 1 Posted June 23, 2011 (edited) Hi, I've try different way to do this (stringregex seems the solution but can't find how) but still no solution : let's say I have a string "word1_word2" I have a search input to search in thousands of strings, and I would like to search for "word1 word2" and find "word1_word2" This behavior would work for " ", "_", "-", both in search and in the string. Any idea ? I've tried to stringsplit and then add some "(.*?)" in a new string, and regex search but doesn't work. Global $search = "word1 word2" Global $chaine = "bbbword1_word2bbb" $searcharray = StringSplit($Search," _-",0) If @error <> 1 Then $newsearch = "" For $i = 1 to $searcharray[0] $newsearch &= $searcharray[$i]&"(.*?)" Next $newsearch = "(.*?)" & $newsearch ConsoleWrite(@CR&$newsearch) EndIf Local $j = 0 For $t = 1 to $searcharray[0] ConsoleWrite(@CR&$searcharray[$t]) If StringRegExp($chaine, $newsearch, 0) Then $j += 1 ConsoleWrite(@CR&"found one occurence!"&@CR) EndIf Next Edited June 23, 2011 by kiboost Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79 Share this post Link to post Share on other sites
kiboost 1 Posted June 23, 2011 hmm it seems to work now, sorry. Can't see how to delete this post anyway. Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79 Share this post Link to post Share on other sites