#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?i)((face*book|(\bface.*book|face.*book.com\b/)).+\d)|(face.*book)|(\bface.*book|face.*book.com\b/.*id\S+\d)|(face.*book.com\b/.*id.\d+.*)"
Local $sString = "facebook" & @CRLF & _
"face book" & @CRLF & _
"faceBook" & @CRLF & _
"Facebook" & @CRLF & _
"FaceBook.com" & @CRLF & _
"https://facebook.com/99402349034" & @CRLF & _
"facebook.com" & @CRLF & _
"facebook.com/" & @CRLF & _
"face" & @CRLF & _
"book" & @CRLF & _
"facebook.com" & @CRLF & _
"face-book.com" & @CRLF & _
"394023894230984" & @CRLF & _
"https://facebook.com/zuck" & @CRLF & _
"https://www.facebook.com/profile.php?id=100001533612613" & @CRLF & _
"https://m.facebook.com/ChrisHughes" & @CRLF & _
"facebook.com/id=xkdjfksjdflkdjfk" & @CRLF & _
"https://www.facebook.com/profile.php?100001533612613" & @CRLF & _
"https://www.facebook.com/profile.php?id=1d00001533612613" & @CRLF & _
"https://www.facebook.com/akld20322k332" & @CRLF & _
"https://www.facebook.com/profile.php?id=100001533612613" & @CRLF & _
"" & @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