#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^((\.{2}\\)+|(\.?\\)?).+[^:\r\n]$"
Local $sString = "Directories:" & @CRLF & _
"" & @CRLF & _
"\\Reports\Test\\Test" & @CRLF & _
"..\meeting_minutes" & @CRLF & _
"..\..\profile" & @CRLF & _
"Reports\2023\summary" & @CRLF & _
"\Reports\2023\summary" & @CRLF & _
".\Reports\2023\summary" & @CRLF & _
"..\Projects\project_a" & @CRLF & _
"..\Projects\project a" & @CRLF & _
"..\Projects\..\.\project\.\..\a" & @CRLF & _
".\my_file" & @CRLF & _
"..\Music#a\file" & @CRLF & _
"..\Music[Genre]\file" & @CRLF & _
"..\Music(Genre)\file" & @CRLF & _
"..\Music-Hardcore-Metal\file" & @CRLF & _
"..\Documents\My+File" & @CRLF & _
"..\Documents\Some{Document}" & @CRLF & _
"..\Files\Afilewithweird;Characters'`" & @CRLF & _
"..\Music#^@!()-+{};',.`~a\file" & @CRLF & _
"." & @CRLF & _
"..\" & @CRLF & _
"..\.." & @CRLF & _
"..\..\" & @CRLF & _
"\\Reports\Test\\Test" & @CRLF & _
"..\..\Final" & @CRLF & _
".\..\Test" & @CRLF & _
".\..\Test\" & @CRLF & _
"..\..\.\Final\..\Shapefiles\.\Landuse" & @CRLF & _
"..\..\.\Final\..\Shapefiles\.\Landuse\" & @CRLF & _
"..\..\data" & @CRLF & _
"./data-files/geological/EQs_last_week_of_2021.csv../data-files/geological/" & @CRLF & _
"EQs_last_week_of_2021.csv../../data-files/EQs_last_week_of_2021.csv../../../data-files/" & @CRLF & _
"media\🎵 music\lo-fi & chill\set_03 (remastered)" & @CRLF & _
"..\..\data\[raw]_input_🧪\test-sample(01)" & @CRLF & _
"src\core.modules\engine@v4" & @CRLF & _
"docs\2025_06\📝meeting_notes (draft)\summary" & @CRLF & _
"docs\2025_06\📝meeting_notes (draft)\summary\" & @CRLF & _
"Files\" & @CRLF & _
"Files" & @CRLF & _
"EQs_last_week_of_2021.csv../../../data-files/geological/EQs_last_week_of_2021" & @CRLF & _
"../pictures/file" & @CRLF & _
".\temp\[backup]_2024\final-version (2)" & @CRLF & _
"assets\images\new.logo-2025_v2\icon@2x#1" & @CRLF & _
"..\users\username\Documents (Archived)\plan[final]" & @CRLF & _
"projects\#active-clients\ACME_Corp\Q2 Report\summary v1.3\" & @CRLF & _
"config\env-settings\!urgent" & @CRLF & _
"media\🎵 music\lo-fi & chill\set_03 (remastered)" & @CRLF & _
"..\..\data\[raw]_input_🧪\test-sample(01)" & @CRLF & _
"src\core.modules\engine@v4" & @CRLF & _
"docs\2025_06\meeting_notes (draft)\📝summary_notes" & @CRLF & _
"themes\🌑 darkmode (beta)\style-final!" & @CRLF & _
"..\..\logs\🪵 log-archive\2023-12-25Christmas" & @CRLF & _
"..\..\logs\🪵 log-archive\2023-12-25[Christmas]" & @CRLF & _
"..\..\logs\🪵 log-archive\2023-12-25 [Christmas]" & @CRLF & _
"downloads\zips\patch_update v34-final!" & @CRLF & _
"build\#output$\v2.1.1\installer(64bit)" & @CRLF & _
"components\UI-Toolkit_🔥\modaldialog" & @CRLF & _
"scripts\batch jobs\cleanup-temp_files!" & @CRLF & _
"resources\📁 static\fonts\Roboto_Bold-Italic" & @CRLF & _
"tests\[integration]_suite#2\test-case(01)" & @CRLF & _
"temp\$$merge_conflict\attempt_#3\resolved✅" & @CRLF & _
"locales\en-US\messages(v1" & @CRLF & _
"backup\[legacy]_configs\1999" & @CRLF & _
"src\modules\@internal\storage-handler" & @CRLF & _
"..\releases\build#2025.06.14\installer-vFinal" & @CRLF & _
"app\#dev[tools]\init" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Files:" & @CRLF & _
"..\users\username\Documents (Archived)\plan[final]\theplan.txt" & @CRLF & _
"projects\#active-clients\ACME_Corp\Q2 Report\summary v1.3\summary.txt" & @CRLF & _
"config\env-settings\!urgent\OVERVIEW.XLSX" & @CRLF & _
"media\🎵 music\lo-fi & chill\set_03 (remastered)\Cool Song.mp3" & @CRLF & _
"..\..\data\[raw]_input_🧪\test-sample(01)\Sample.db" & @CRLF & _
"src\core.modules\engine@v4\engine.exe" & @CRLF & _
"docs\2025_06\meeting_notes (draft)\📝summary_notes.txt" & @CRLF & _
"themes\🌑 darkmode (beta)\style-final!.update" & @CRLF & _
"build\#output$\v2.1.1\installer(64bit)\install_x64.msi" & @CRLF & _
"resources\📁 static\fonts\Roboto_Bold-Italic.ttf" & @CRLF & _
"" & @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