#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "#(?!:[\w]+)(?=([\w\d\[\]\,\*\=\>\.\s]*[\{\,\[]+))"
Local $sString = "div#xyz, #xyz, div#xyz[id='xyz']," & @CRLF & _
" .def>#xyz, .def>div#xyz, .def>#xyz," & @CRLF & _
" .def>div#xyz[id=*]{" & @CRLF & _
" color:#ee2ee2;" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"@media (min-width: 30em) and (orientation: landscape) " & @CRLF & _
"{" & @CRLF & _
" .abc{" & @CRLF & _
" background-color :#FFFFFF;" & @CRLF & _
" border-color:1px solid #eee ;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" .def>#xyz, .def #xyz, .def>#xyz{border-color:1px solid #ddd;}" & @CRLF & _
"}"
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