kiboost Posted June 23, 2011 Share 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 Link to comment Share on other sites More sharing options...
kiboost Posted June 23, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now