#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(>\s+<)"
Local $sString = "<ul class="list-group sidebar-nav-v1 margin-bottom-40" id="menuHomeUserPrivate"> " & @CRLF & _
" <li class="list-group-item active">" & @CRLF & _
" <a id="to_ProfileOverall" class="privateMenuLinkJS"><i class="fa fa-bar-chart-o"></i> Overall</a>" & @CRLF & _
" </li>" & @CRLF & _
" <li class="list-group-item list-toggle">" & @CRLF & _
" <a data-toggle="collapse" data-parent="#menuHomeUserPrivate" href="#collapse-MoneyManage" ><i class="fa fa-money"></i> Invoice</a>" & @CRLF & _
" <ul id="collapse-MoneyManage" class="collapse">" & @CRLF & _
" <li><a id="to_MoneyManagerFaturamentoInsert" class="privateMenuLinkJS"><i class="fa fa-level-down"></i> Big Invoice </a></li>" & @CRLF & _
" <li><a id="to_MoneyManagerFaturamentoGerir" class="privateMenuLinkJS"><i class="fa fa-cogs"></i> Big big big" & @CRLF & _
" " & @CRLF & _
" Invoice 2 </a></li>" & @CRLF & _
" </ul>" & @CRLF & _
" </li>" & @CRLF & _
" </ul>"
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