#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<=\G(?!^)|\@apply) ([^\s\;]*|[\p{P}]*)"
Local $sString = "/* Adds custom prefix to tailwind classes */" & @CRLF & _
"/* https://v2.tailwindcss.com/docs/just-in-time-mode#:~:text=Don%27t%20use%20spaces%20in%20arbitrary%20values */" & @CRLF & _
"@apply rounded text-md;" & @CRLF & _
"@apply rounded text-md aaaa;" & @CRLF & _
"@apply grid-cols-[1fr,700px,2fr] text-[var(--mystery-var)] text-[color:var(--mystery-var)];" & @CRLF & _
"@apply rounded text-md w-[calc(asdasd-ssd)];"
Local $sSubst = " tw-$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