willichan 220 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? Join me in supporting Pediatric Therapy Network through Amazon Smile. 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 Share this post Link to post Share on other sites
PsaltyDS 41 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 Share this post Link to post Share on other sites
willichan 220 Posted July 27, 2010 @PsaltyDS That did the trick. Thank you. Join me in supporting Pediatric Therapy Network through Amazon Smile. 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 Share this post Link to post Share on other sites