#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\b((bc|tb)(0([ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59})|1[ac-hj-np-z02-9]{8,87})|([13]|[mn2])[a-km-zA-HJ-NP-Z1-9]{25,39})\b\s"
Local $sString = "BTC Address: 1JHwenDp9A98XdjfYkHKyiE3R99Q72K9X4 " & @CRLF & _
"BTC Address: 1Unoc4af6gCq3xzdDFmGLpq18jbTW1nZD" & @CRLF & _
"BTC Address: 1A8Ad7VbWDqwmRY6nSHtFcTqfW2XioXNmj" & @CRLF & _
"BTC Address: 12CZYvgNZ2ze3fGPFzgbSCELBJ6zzp2cWc" & @CRLF & _
"BTC Address: 17drmHLZMsCRWz48RchWfrz9Chx1osLe67" & @CRLF & _
"" & @CRLF & _
"Receiving Bitcoin Address: 15LZALXitpbkK6m2QcbeQp6McqMvgeTnY8" & @CRLF & _
"Receiving Bitcoin Address: 1MAFzYQhm6msF2Dxo3Nbox7i61XvgQ7og5" & @CRLF & _
"" & @CRLF & _
"--------------------------------------------------------" & @CRLF & _
"Other possible BitCoin test cases I added:" & @CRLF & _
"--------------------------------------------------------" & @CRLF & _
"- What if text comes before and/or after on same line? Or doesn't contain BitCoin/BTC/etc. anywhere (or anywhere close to the address)?" & @CRLF & _
" Send BitCoin payments here 1MAFzYQhm6msF2Dxo3Nbox7i61XvgQ7og5" & @CRLF & _
" 1MAFzYQhm6msF2Dxo3Nbox7i61XvgQ7og5 to keep your secrets safe." & @CRLF & _
" Send payments here 1MAFzYQhm6msF2Dxo3Nbox7i61XvgQ7og5 to keep your secrets safe." & @CRLF & _
"" & @CRLF & _
"- Standalone address:" & @CRLF & _
" 1Dvd7Wb72JBTbAcfTrxSJCZZuf4tsT8V72" & @CRLF & _
"" & @CRLF & _
"--------------------------------------------------------" & @CRLF & _
"Redacted Body content generating FPs from spam emails:" & @CRLF & _
"--------------------------------------------------------" & @CRLF & _
"src=3D"https://example.com/blah=3D2159024400&t=3DXWP9YVkAYwkmif9RgKeoPhw2b1zdMnMzXZSGRD_Oxkk"" & @CRLF & _
"" & @CRLF & _
""cursor:pointer;color:#6A6C6D;-webkit-text-size-blahutm_campaign%253Drdboards%2526e_t%253Dd5c2deeaae5c4a8b8d2bff4d0f87ecdd%2526utm_cont=blah" & @CRLF & _
"" & @CRLF & _
"src=3D"https://example.com/blah/74/328e74997261d5228886aab1a2da6874.jpg" " & @CRLF & _
"" & @CRLF & _
"src=3D"https://example.com/blah-1c779f59948fc5be8a461a4da8d938aa.jpg"" & @CRLF & _
"" & @CRLF & _
"href=3D"https://example.com/blah-0ff3169b28a6e17ae8a369a3161734c1?alert_=id=blah"
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