#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "((?:\G|\n)(?:.*?&.*?micro.*?;[\s\S]*?|.*?<.*?micro.*?>[\s\S]*?|.)*?)micro"
Local $sString = "micromicro" & @CRLF & _
"asdasdmicromicroasdasd" & @CRLF & _
"µmicro" & @CRLF & _
"µ" & @CRLF & _
"&123micro" & @CRLF & _
"<123 micro" & @CRLF & _
"asdad micro/>" & @CRLF & _
"micro123" & @CRLF & _
"123micro" & @CRLF & _
"" & @CRLF & _
"µ" & @CRLF & _
"<micro>" & @CRLF & _
"<asdmicroasdad />" & @CRLF & _
"&asdmicro123;" & @CRLF & _
"µ" & @CRLF & _
""
Local $sSubst = "$1µ"
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