Tyzing Posted March 18, 2019 Share Posted March 18, 2019 (edited) I'm trying a simple RegEx pattern which just doesn't work on AutoIt but everywhere else, I also tried it on RegEx101.com here's the RegEx101: https://regex101.com/r/rookZ2/1 Here's the AutoIt Code (Of course the file content is correct) #include <Array.au3> $f = FileOpen("C:\Users\Lucas\Documents\test.txt",0) $fdata = FileRead($f) FileClose($f) $tresult = StringRegExp($fdata,'^ABC=(0x.*)$',1) MsgBox(0,@error,@extended) _ArrayDisplay($tresult) Edited March 18, 2019 by Tyzing Link to comment Share on other sites More sharing options...
jdelaney Posted March 18, 2019 Share Posted March 18, 2019 consolewrite($fdata) Make sure you read in the file properly IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Tyzing Posted March 18, 2019 Author Share Posted March 18, 2019 Of course I already did that, I even checked the file with a hex editor if the line breaks are correct and everything was fine. All other tools that have some kind of RegEx feature like Notepad++ work just fine with my pattern Link to comment Share on other sites More sharing options...
jdelaney Posted March 18, 2019 Share Posted March 18, 2019 $tresult = StringRegExp($fdata,'^ABC=(0x.*)\b',1) Not sure why the dollar sign isn't working. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
jdelaney Posted March 18, 2019 Share Posted March 18, 2019 $tresult = StringRegExp($fdata,'(?m)^ABC=(0x.*)$',1) here we go. Tyzing 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Tyzing Posted March 18, 2019 Author Share Posted March 18, 2019 Oh wow thanks so much, it's working 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