littlebigman Posted May 15, 2023 Share 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 15, 2023 Developers Share 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. Link to comment Share on other sites More sharing options...
Solution pixelsearch Posted May 15, 2023 Solution Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted May 15, 2023 Developers Share 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. Link to comment Share on other sites More sharing options...
littlebigman Posted May 15, 2023 Author Share 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 :-) 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