#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)\bp(ost|ostal)?(([ \.]*(O|0|o)(ffice)?)|([ \.]*box))([ \.]*Box)?\b"
Local $sString = "po box 1272" & @CRLF & _
"po box 29407" & @CRLF & _
"3001 p street suite a" & @CRLF & _
"po box 882" & @CRLF & _
"490 post st ste 700" & @CRLF & _
"530 post cpurt" & @CRLF & _
"530 post ct" & @CRLF & _
"postal box 1216" & @CRLF & _
"2 mile klondike highway po box 440" & @CRLF & _
"mile 1.5 klondike hwy po box 535" & @CRLF & _
"346 a tundra way po box 324" & @CRLF & _
"7307 s frontier drive/po box 877509" & @CRLF & _
"4540 edinburgh dr. po box 545, king salmon" & @CRLF & _
"650 oliver rd. po box 241702" & @CRLF & _
"#320 fortaleza street, po box 9024070," & @CRLF & _
"10 el campo" & @CRLF & _
""
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