#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?sm)(?<![\.\n]) ?\n(?!\n)"
Local $sString = "Below, we present an" & @CRLF & _
"introduction to advanced." & @CRLF & _
"regular expressions, with eight commonly used concepts and examples." & @CRLF & _
"Each example outlines a simple way to match patterns in complex strings." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"If you do not yet have experience with basic regular expressions, have a look at this article to get started. The syntax used here matches PHP regular expressions.Regular expressions (or regex) are a powerful way to traverse large strings in order to find information. They rely on underlying patterns in a string’s structure to work their magic. Unfortunately, simple regular expressions are unable to cope with complex patterns and symbols. To deal with this dilemma, you can use advanced regular expressions."
Local $sSubst = " "
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm