#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)(^127\.0\.0\.1[\s]+|^0\.0\.0\.0[\s]+)([0-9a-z_.-]+$)|^([0-9a-z_.-]+$)"
Local $sString = "# hpHosts - FSA only" & @CRLF & _
"#" & @CRLF & _
"# The following are hosts in the hpHosts database with the FSA classification ONLY." & @CRLF & _
"#" & @CRLF & _
"127.0.0.1 localhost #IPv4 localhost" & @CRLF & _
"127.0.0.1 localhost" & @CRLF & _
"::1 localhost #IPv6 localhost" & @CRLF & _
"#" & @CRLF & _
"# BAD SITES START HERE" & @CRLF & _
"#" & @CRLF & _
"0.0.0.0 very#badexample.com" & @CRLF & _
"very#badexample.com" & @CRLF & _
"domain@with.com" & @CRLF & _
"doma$in" & @CRLF & _
"AuThedMine.cOm" & @CRLF & _
"domain.0cf" & @CRLF & _
"127.0.0.1 0-0-----------------------------------------------------------0.com" & @CRLF & _
"127.0.0.1 0-google.com" & @CRLF & _
"127.0.0.1 00-lawyer.com" & @CRLF & _
"127.0.0.1 0000.support" & @CRLF & _
"0.01.2.13.3.sydneypropertyinvestors.com" & @CRLF & _
"0.01.2.23.3.sydneypropertyinvestors.com" & @CRLF & _
"000.9.009.09.ekurbani.com" & @CRLF & _
"000.9.019.09.ekurbani.com" & @CRLF & _
"000000-0.000webhostapp.com" & @CRLF & _
"00004563.000webhostapp.com" & @CRLF & _
"000m8ih.wcomhost.com" & @CRLF & _
"000m8n1.wcomhost.com" & @CRLF & _
"000m8pk.wcomhost.com" & @CRLF & _
"000m9w3.wcomhost.com" & @CRLF & _
"000macu.wcomhost.com" & @CRLF & _
"000magu.wcomhost.com" & @CRLF & _
"000map9.wcomhost.com" & @CRLF & _
"000may2.wcomhost.com" & @CRLF & _
"000mhl7.wcomhost.com" & @CRLF & _
"000mhpe.wcomhost.com" & @CRLF & _
"000mhpg.wcomhost.com" & @CRLF & _
"1xbet86.com" & @CRLF & _
"1xbet87.com" & @CRLF & _
"1xbet90.com" & @CRLF & _
"1xbet31.com" & @CRLF & _
"1xbet46.com" & @CRLF & _
"1xbet28.com" & @CRLF & _
"1xbet35.com" & @CRLF & _
"1xbet49.com" & @CRLF & _
"nejakyhost.cz" & @CRLF & _
"0.0.0.0 cnhv.co" & @CRLF & _
"0.0.0.0 coin-hive.com" & @CRLF & _
"0.0.0.0 coinhive.com" & @CRLF & _
"0.0.0.0 authedmine.com" & @CRLF & _
"0.0.0.0 api.jsecoin.com" & @CRLF & _
"0.0.0.0 load.jsecoin.com" & @CRLF & _
"0.0.0.0 server.jsecoin.com" & @CRLF & _
"0.0.0.0 miner.pr0gramm.com" & @CRLF & _
"0.0.0.0 minemytraffic.com" & @CRLF & _
"0.0.0.0 crypto-loot.com" & @CRLF & _
"0.0.0.0 cryptaloot.pro" & @CRLF & _
"0.0.0.0 cryptoloot.pro" & @CRLF & _
"0.0.0.0 coinerra.com" & @CRLF & _
"0.0.0.0 coin-have.com" & @CRLF & _
"0.0.0.0 minero.pw" & @CRLF & _
"0.0.0.0 minero-proxy-01.now.sh" & @CRLF & _
"0.0.0.0 minero-proxy-02.now.sh" & @CRLF & _
"0.0.0.0 minero-proxy-03.now.sh" & @CRLF & _
"0.0.0.0 api.inwemo.c" & @CRLF & _
"127.0.0.1 sfdfsdfsdfsdfsd" & @CRLF & _
"pool.pebblemedia.adhese.com"
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