willichan Posted July 27, 2010 Share Posted July 27, 2010 Is there a way to tell AutoIt to let .* match characters that span multiple lines? For example: $sTheData = "<tag1>" & @CRLF & _ "<tag2>" & @CRLF & _ "# some stuff here" & @CRLF & _ "</tag2>" & @CRLF & _ "<tag3>" & @CRLF & _ "# some more stuff here" & @CRLF & _ "</tag3>" & @CRLF & _ "</tag1>" MsgBox(0,"Regular Expressions Test", StringRegExpReplace( $sTheData, "<tag2>.*</tag2>", "")) This should strip out tag2 and all of its contents. But, since <tag2> and </tag2> are not on the same line, this does not work, because the .* stops matching at the CR or LF characters. Any suggestions? My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 27, 2010 Share Posted July 27, 2010 You can add "(?s)" to the beginning of your RegExp pattern. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
willichan Posted July 27, 2010 Author Share Posted July 27, 2010 @PsaltyDS That did the trick. Thank you. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash 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