#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(° ?)?[0-9]+(\.[0-9]+)? ?°? ?[fF]\b"
Local $sString = "23°F" & @CRLF & _
"23° F" & @CRLF & _
"23°f" & @CRLF & _
"23° F" & @CRLF & _
"°23f" & @CRLF & _
"°23F" & @CRLF & _
"23.3 F" & @CRLF & _
"23.3f" & @CRLF & _
"212°F" & @CRLF & _
"° 27 f" & @CRLF & _
"27 ° f" & @CRLF & _
"28 °F" & @CRLF & _
"29 °f" & @CRLF & _
"There are 10 flies on the wall and this sentence must not match."
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