#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\b(?:G,C,D|A,B,C|E,C,D)|(?:[ABCDEFG](?:#|b)?)(?:\/[ABCDEFG]b)?(?:(?:(?:maj|min|sus|add|aug|dim)(?:\d{0,2}(?:#\d{1,2}|sus\d)?)?)|(?:m\d{0,2}(?:(?:maj|add|#)\d{0,2})?)|(?:-?\d{0,2}(?:\([^)]*\)|#\d{1,2})?))?"
Local $sString = "<p>Intro:G,C,D D, A, Em, Eb Ebb G G,C,D</p>" & @CRLF & _
"A,B,C <p><br />" & @CRLF & _
" Verse 1:</p> <p> D A Em <br />" & @CRLF & _
" Yeah I've iced down a few thousand beers in my days<br />" & @CRLF & _
" G <br />" & @CRLF & _
" You put down twice as many<br /> D A Em <br />" & @CRLF & _
"C9 G C#/Db C# Dsus2sus4" & @CRLF & _
"" & @CRLF & _
"Dmaj13#11" & @CRLF & _
"Bmaj13#11" & @CRLF & _
"" & @CRLF & _
"A7(b5,#9)" & @CRLF & _
"" & @CRLF & _
"A7#9" & @CRLF & _
"" & @CRLF & _
"B-5" & @CRLF & _
"" & @CRLF & _
"#sus #maj #min #aug"
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