#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\{([^\{\}]|(?R))*\}"
Local $sString = "Wind energy is the kinetic energy of air in motion, also called wind. Total wind energy flowing through an imaginary surface with area A during the time t is:" & @CRLF & _
"{\displaystyle E={\frac {1}{2}}mv^{2}={\frac {1}{2}}(Avt\rho )v^{2}={\frac {1}{2}}At\rho v^{3},} E={\frac {1}{2}}mv^{2}={\frac {1}{2}}(Avt\rho )v^{2}={\frac {1}{2}}At\rho v^{3},[248]" & @CRLF & _
"where ρ is the density of air; v is the wind speed; Avt is the volume of air passing through A (which is considered perpendicular to the direction of the wind); Avtρ is therefore the mass m passing through "A". Note that ½ ρv2 is the kinetic energy of the moving air per unit volume." & @CRLF & _
"Power is energy per unit time, so the wind power incident on A (e.g. equal to the rotor area of a wind turbine) is:" & @CRLF & _
"{\displaystyle P={\frac {E}{t}}={\frac {1}{2}}A\rho v^{3}.} P={\frac {E}{t}}={\frac {1}{2}}A\rho v^{3}.[248]" & @CRLF & _
"Wind power in an open air stream is thus proportional to the third power of the wind speed; the available power increases eightfold when the wind speed doubles. Wind turbines for grid electric power therefore need to be especially efficient at greater wind speeds."
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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