#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)([(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=-]{2,256}\.[a-z]{2,6}|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\b([-a-zA-Z0-9@:%_\+~#?&\/\/=]*)|(http(s)?:\/\/\/?)"
Local $sString = "Title: Government URLs" & @CRLF & _
"Author: DigitalGov Search" & @CRLF & _
"Keywords: " & @CRLF & _
"Scope: Federal, state, local, tribal, and territorial government websites that aren\'t *.gov or *.mil." & @CRLF & _
"" & @CRLF & _
"Quarterly updates are also posted at https://github.com/GSA/govt-urls." & @CRLF & _
"URI: http://govt-urls.usa.gov/tematres/vocab/" & @CRLF & _
"Powered by: TemaTres 1.63" & @CRLF & _
"Something: geekdrop.com" & @CRLF & _
"Catch 3 Slashes SSL: https:///" & @CRLF & _
"Catch 3 Slashes: http://" & @CRLF & _
"__________________________________________________________________________" & @CRLF & _
"" & @CRLF & _
"1-800-vermont.com" & @CRLF & _
"created: 2013-06-06 19:11:14" & @CRLF & _
" Scope note: Travel and Tourism Site for Vermont" & @CRLF & _
" RTET: VermontVacation.com" & @CRLF & _
" BT: usagovVT" & @CRLF & _
"" & @CRLF & _
"174.132.145.94/~hope" & @CRLF & _
"created: 2013-06-06 18:09:02" & @CRLF & _
"modified: 2013-11-20 15:27:15" & @CRLF & _
" Scope note: Town of Hope Mills, NC" & @CRLF & _
" BT: usagovNC" & @CRLF & _
" UF: townofhopemills.com" & @CRLF & _
"" & @CRLF & _
"1800arkansas.com" & @CRLF & _
" USE: arkansasedc.com" & @CRLF & _
"" & @CRLF & _
"1800runaway.org" & @CRLF & _
"created: 2014-01-10 19:15:25" & @CRLF & _
" Scope note: The National Runaway Safeline serves as the federally designated national communication system for runaway and homeless youth. Services are provided through funding from Family and Youth Services Bureau in the Administration for Children and Families, U.S. Department of Health and Human Services and the generosity of private funders (individual donors, corporate partners, and foundation grants)." & @CRLF & _
" BT: usagovQUASI" & @CRLF & _
"" & @CRLF & _
"211.getcare.com" & @CRLF & _
"created: 2014-05-27 14:12:29" & @CRLF & _
" Scope note: 2-1-1 VIRGINIA is a service of the Virginia Department of Social Services provided in partnership with the Council of Community Services, the Family Resource and Referral Center, The Planning Council, the United Way of Central Virginia, and the United Way of Greater Richmond and Petersburg." & @CRLF & _
" RT: 211virginia.org" & @CRLF & _
" BT: usagovVA" & @CRLF & _
"" & @CRLF & _
"211virginia.org" & @CRLF & _
"created: 2014-01-10 19:17:31" & @CRLF & _
" Scope note: 2-1-1 VIRGINIA is a service of the Virginia Department of Social Services provided in partnership with the Council of Community Services, the Family Resource and Referral Center, The Planning Council, the United Way of Central Virginia, and the United Way of Greater Richmond and Petersburg." & @CRLF & _
" RT: 211.getcare.com" & @CRLF & _
" BT: usagovVA" & @CRLF & _
"" & @CRLF & _
"360eldorado.com/Government" & @CRLF & _
"created: 2013-11-19 12:54:52" & @CRLF & _
" Scope note: City of El Dorado, KS" & @CRLF & _
" RT: eldoks.com" & @CRLF & _
" BT: usagovKS" & @CRLF & _
"" & @CRLF & _
"3riverscfc.org" & @CRLF & _
"created: 2013-06-06 18:08:14" & @CRLF & _
" Scope note: 3 Rivers/Pennsylvania West Combined Federal Campaign" & @CRLF & _
" BT: usagovOH" & @CRLF & _
" BT: usagovPA" & @CRLF & _
" BT: usagovWV" & @CRLF & _
"" & @CRLF & _
"4thjudicialda.com" & @CRLF & _
"created: 2014-01-10 19:17:31" & @CRLF & _
" Scope note: 4th Judicial District Attorney" & @CRLF & _
" BT: usagovCO" & @CRLF & _
"" & @CRLF & _
"511ny.org" & @CRLF & _
"created: 2014-01-24 14:33:30" & @CRLF & _
" Scope note: 511 NY (New York State Department of Transportation), the free, official one-stop, all-encompassing telephone and Web service offering information on transportation services and conditions throughout New York State." & @CRLF & _
" BT: usagovNY" & @CRLF & _
"" & @CRLF & _
"800alabama.com" & @CRLF & _
" USE: alabama.travel" & @CRLF & _
"" & @CRLF & _
"911digitalarchive.org" & @CRLF & _
"created: 2013-06-06 18:08:14" & @CRLF & _
" Scope note: The September 11 Digital Archive (funded by a major grant from the Alfred P. Sloan Foundation and organized by the American Social History Project at the City University of New York Graduate Center and the Center for History and New Media at George Mason University)" & @CRLF & _
" BT: usagovQUASI" & @CRLF & _
"" & @CRLF & _
"aacounty.org" & @CRLF & _
"created: 2013-06-06 18:08:14" & @CRLF & _
" Scope note: Anne Arundel County, MD" & @CRLF & _
" BT: usagovMD" & @CRLF & _
"" & @CRLF & _
"aapcc.org" & @CRLF & _
"created: 2014-01-10 19:19:24" & @CRLF & _
" Scope note: American Association of Poison Control Centers" & @CRLF & _
" BT: usagovQUASI" & @CRLF & _
"" & @CRLF & _
"aatwp.org" & @CRLF & _
"created: 2013-06-06 18:08:14" & @CRLF & _
" BT: usagovMI" & @CRLF & _
"" & @CRLF & _
"aberdeen-md.org" & @CRLF & _
"created: 2013-06-06 18:08:14" & @CRLF & _
" Scope note: City of Aberdeen, MD" & @CRLF & _
" BT: usagovMD" & @CRLF & _
"" & @CRLF & _
"aberdeen.sd.us" & @CRLF & _
"created: 2013-06"
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