#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)^(.*?)\s?(?|(?:dek[ae]t\s(.+)\sradius\s(\d+(?:\.\d+)?)\s?(k?m))|(?:dek[ae]t\s(.+)))"
Local $sString = "rumah dekat ugm" & @CRLF & _
"rumah dekat ugm radius 3 km" & @CRLF & _
"rumah dekat ugm radius 500m" & @CRLF & _
"rumah dekat sindu park radius 5 km" & @CRLF & _
"rumah dekat sindu park radius 1.5 km" & @CRLF & _
"rumah dekat De Mata Trick Eye Museum radius 12 km" & @CRLF & _
"apartemen dekat UII radius 2 km" & @CRLF & _
"dekat ugm radius 3 km"
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