littlebigman Posted May 15, 2023 Posted May 15, 2023 Hello, I notice something odd when using the StringRegExp() function: Although the string does start on a newline, the function can't find it if I use the "^" header: $File = FileOpen(@ScriptDir & "\input.html") $FileRead = FileRead($File) FileClose($File) ;BAD if StringRegExp($FileRead,"^Last updated .+</body>", $STR_REGEXPMATCH ) then if StringRegExp($FileRead,"Last updated .+</body>", $STR_REGEXPMATCH ) then MsgBox($MB_OK,"1",$sOutput) else MsgBox($MB_OK, "2", $sOutput) EndIf Does FileRead() remove CRLF's? Thank you.
Developers Jos Posted May 15, 2023 Developers Posted May 15, 2023 (edited) 10 minutes ago, littlebigman said: Does FileRead() remove CRLF's? Nope, ..... so maybe you can post a running reproducer script and inputfile that demonstrates your issue? Edited May 15, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Solution pixelsearch Posted May 15, 2023 Solution Posted May 15, 2023 Don't you need (?m) to do that ? (?m) Multiline: ^ and $ match at newline sequences within data. By default, multiline is off. littlebigman 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
Developers Jos Posted May 15, 2023 Developers Posted May 15, 2023 14 minutes ago, pixelsearch said: Don't you need (?m) to do that ? Correct! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
littlebigman Posted May 15, 2023 Author Posted May 15, 2023 37 minutes ago, pixelsearch said: Don't you need (?m) to do that ? (?m) Multiline: ^ and $ match at newline sequences within data. By default, multiline is off. Thanks :-)
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