kudrow Posted January 15, 2015 Author Posted January 15, 2015 No it's not. It is essentially the same as Stringregexp($data, '\b\Q' & $Password & '\E\b') as suggested earlier. The OP's problem was not making the match restrictive enough. kylomas I understand! That is the part I was missing (not restrictive enough). Thank you everyone! Both examples worked!
Valuater Posted January 15, 2015 Posted January 15, 2015 Obviously, the OP can use stringinstr() then verify with == 8)
mikell Posted January 15, 2015 Posted January 15, 2015 Stringregexp($data, '\b\Q' & $password & '\E\b') Hmmm... this regex matches "p@" in "p@g@"
jguinch Posted January 15, 2015 Posted January 15, 2015 Yes... We should have an example of what the text file contains. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
kylomas Posted January 15, 2015 Posted January 15, 2015 <post deleted> Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
kudrow Posted January 15, 2015 Author Posted January 15, 2015 the text file contains _password_ siteip-192.168.10.105 unl I ended up putting underscores on both sides of the password and then used the following code $chckpass = StringInStr($datafile, "_" & $password & "_") If $chckpass > 0 Then I used a ">" in the "If" statement because the StringInStr will return a number greater than 0 if there is a match. This seems to be working for me. Should I be aware of any problems this route may cause? Oh I didn't try case sensitive.
Moderators SmOke_N Posted January 15, 2015 Moderators Posted January 15, 2015 (edited) StringRegExp($datafile, "(?m)^Q" & $password & "E$") Edit: An ini file makes much more sense here after seeing the above file format. Edited January 15, 2015 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Solution JohnOne Posted January 15, 2015 Solution Posted January 15, 2015 the text file contains _password_ siteip-192.168.10.105 unl I ended up putting underscores on both sides of the password and then used the following code $chckpass = StringInStr($datafile, "_" & $password & "_") If $chckpass > 0 Then I used a ">" in the "If" statement because the StringInStr will return a number greater than 0 if there is a match. This seems to be working for me. Should I be aware of any problems this route may cause? Oh I didn't try case sensitive. For the record, if the return is 0 it resolves to false. Anything else resolves to True. So If $chckpass Then Is perfectly acceptable. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
jguinch Posted January 15, 2015 Posted January 15, 2015 (edited) So we guess that the line where the password appears contains ONLY the password ? Edit : If it is the case, SmOke_N's previous code should work Edited January 15, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
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