#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?i)(ejection fraction|L?V?EF)[\s\w:<>=]+(\d\d)[\d-]*%?"
Local $sString = "Diastolic dysfunction, last ejection fraction =55%" & @CRLF & _
"" & @CRLF & _
"The patient during his hospital stay had an echocardiogram, which showed an ejection fraction of more then 60%" & @CRLF & _
"" & @CRLF & _
"Her ejection fraction remained high with a left ventricular ejection fraction of 70-80." & @CRLF & _
"" & @CRLF & _
"Ejection fraction was 45%." & @CRLF & _
"" & @CRLF & _
"An ejection fraction of 84 percent" & @CRLF & _
"" & @CRLF & _
"Overall left ventricular systolic function is low normal (LVEF 50-55%)." & @CRLF & _
"" & @CRLF & _
"Left ventricular wall thickness, cavity size and regional/global systolic function are normal (LVEF >55%)"
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