#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "^((`{3}\\\\s*)(\\\\w+)?(\\\\s*([\\\\w\\\\W]+?)\\\\n*)\\\\2)\\\\n*(?:[^\\\\S\\\\w\\\\s]|$)" & @CRLF & _
""
Local $sString = "\documentclass[12pt]{article}" & @CRLF & _
"\title{Memoria}" & @CRLF & _
"\author{Jose Serodio Ignacio}" & @CRLF & _
"\usepackage[spanish, activeacute]{babel} % Definir idioma español" & @CRLF & _
"\usepackage[utf8]{inputenc} % Codificación utf-8" & @CRLF & _
"" & @CRLF & _
"\begin{document}" & @CRLF & _
"" & @CRLF & _
"\maketitle" & @CRLF & _
"" & @CRLF & _
"\section{Introducción}" & @CRLF & _
"% Descripción y situación del trabajo" & @CRLF & _
"Industria de Turbo Propulsores (en adelante ITP) es una empresa asca dedicad" & @CRLF & _
"al diseño y fabricación de motores aeronáuticos y turbinas de gas.\\"
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