#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\b(??px)(?<!(?<!\S)\.)(\d*)(\d)(?:\.(\d+))?px\b"
Local $sString = "font-size: 10px;" & @CRLF & _
"border: 0px;" & @CRLF & _
"margin-top: 4px; // dont touch" & @CRLF & _
"margin-bottom: 12px;" & @CRLF & _
"margin-right: 50%;" & @CRLF & _
"margin-left: -12px;" & @CRLF & _
"padding-left: 120px;" & @CRLF & _
"padding-right: 8px;" & @CRLF & _
"border-radius: calc(50% - 1px); // dont touch" & @CRLF & _
"grid-template-columns: 1fr 44px 1fr;" & @CRLF & _
"margin-top: 36.4px;" & @CRLF & _
"border-width: 10.5px;" & @CRLF & _
"border-width: .3px; // dont touch" & @CRLF & _
"border-width: .6px; // dont touch" & @CRLF & _
"border-width: 3.3px; // dont touch" & @CRLF & _
"border-width: 6.6px 4px 8000px .34px;" & @CRLF & _
"margin-left: -1px; // dont touch"
Local $sSubst = "$1.$2$3rem"
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