logmein Posted June 2, 2009 Share Posted June 2, 2009 (edited) I have a paragraph : Now.ini c361e1ef4a8461a80d97b9594f82725a 57ee1cfe85789a1d7630673c77b2501e3ace6519 Back.txt b7a2cf799c19cc5e664c6994bb65a517 ad83558139515700f9506d6c9f75391ff50c4813 Now! I found md5 string 'c361e1ef4a8461a80d97b9594f82725a', how i get the file name before? Note : File name, md5 and sha-1 seperated with Char(9) (tab) Thank!! Edited June 2, 2009 by logmein [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
oMBRa Posted June 2, 2009 Share Posted June 2, 2009 can you post an example of what's should look like the match? Link to comment Share on other sites More sharing options...
JackDinn Posted June 2, 2009 Share Posted June 2, 2009 (edited) hi, $string="Now.ini c361e1ef4a8461a80d97b9594f82725a 57ee1cfe85789a1d7630673c77b2501e3ace6519" $String_split=StringSplit($string,Chr(9),1) $name=$String_split[1] MsgBox(0, '', $name) ;or $string_regEx=StringRegExp($string,"\b(.+?)\x09",3) $name=$string_regEx[0] MsgBox(0, '', $name) Edited June 2, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
oMBRa Posted June 2, 2009 Share Posted June 2, 2009 anyway I made 2 patterns for you: #include <Array.au3> $sString = 'Now.ini c361e1ef4a8461a80d97b9594f82725a 57ee1cfe85789a1d7630673c77b2501e3ace6519' & @CRLF & _ 'Back.txt b7a2cf799c19cc5e664c6994bb65a517 ad83558139515700f9506d6c9f75391ff50c4813' $aPattern1 = '(\b\w+\.\w+)(?:\s+)(\b\w+\b)' $aPattern2 = '(\b\w+\.\w+\b\s*\b\w+\b)' $aRegExp = StringRegExp($sString, $aPattern2, 3) _ArrayDisplay($aRegExp) Link to comment Share on other sites More sharing options...
JackDinn Posted June 2, 2009 Share Posted June 2, 2009 (edited) or (?:\b|\x09)(.+?)(?:\x09|$) will get all 3 parts out for ya EDIT:- slim down to (?:\.|\w)+ Edited June 2, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
logmein Posted June 2, 2009 Author Share Posted June 2, 2009 Thanks about the help, but I had generated the MD5 Hash : 'c361e1ef4a8461a80d97b9594f82725a' and i want to know the file name! [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
JackDinn Posted June 2, 2009 Share Posted June 2, 2009 well i thought we had answered that but maybe we all are misunderstanding, please explain with example what you want exactly Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
logmein Posted June 2, 2009 Author Share Posted June 2, 2009 Well, i only want to learn more about StringRegExp, and i want to solve the problem!!! [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
JackDinn Posted June 2, 2009 Share Posted June 2, 2009 well to learn try here its great for the job http://www.regular-expressions.info/tutorial.htmland you need to show us what you want if you want us to solve it as we have already done as best we can with what you have said so far. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Authenticity Posted June 2, 2009 Share Posted June 2, 2009 Well, the MD5 is 32 characters long and the SHA is 40 characters long, right? #include <Array.au3> Global $sPattern, $sStr Global $aMatch $sStr = 'Now.ini' & @TAB & 'c361e1ef4a8461a80d97b9594f82725a' & @TAB & '57ee1cfe85789a1d7630673c77b2501e3ace6519' & @CRLF & _ 'Back.txt' & @TAB & 'b7a2cf799c19cc5e664c6994bb65a517' & @TAB & 'ad83558139515700f9506d6c9f75391ff50c4813' & @CRLF $sPattern = '(?i)(\b\w+?\.\w+)\t\w{32}\t\w{40}' $aMatch = StringRegExp($sStr, $sPattern, 3) If IsArray($aMatch) Then _ArrayDisplay($aMatch) Link to comment Share on other sites More sharing options...
JackDinn Posted June 2, 2009 Share Posted June 2, 2009 (edited) it really dont matter how long the string is if your just looking for the "tabs" as the break point, or even just looking for \w or . characters as below :- (?:\.|\w)+ #include <Array.au3> $sStr = 'Now.ini' & @TAB & 'c361e1ef4a8461a80d97b9594f82725a' & @TAB & '57ee1cfe85789a1d7630673c77b2501e3ace6519' & @CRLF & _ 'Back.txt' & @TAB & 'b7a2cf799c19cc5e664c6994bb65a517' & @TAB & 'ad83558139515700f9506d6c9f75391ff50c4813' & @CRLF $sPattern = '(?:\.|\w)+' $aMatch = StringRegExp($sStr, $sPattern, 3) If IsArray($aMatch) Then _ArrayDisplay($aMatch) MsgBox(0, '', $aMatch[0]) MsgBox(0, '', $aMatch[3]) Edited June 2, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D 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