Jump to content

StringRegExp doesn't match ^


Go to solution Solved by pixelsearch,

Recommended Posts

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.

F5609636-54BC-431E-AED4-3BF733EC793D.png

Link to comment
Share on other sites

  • Developers
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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...