>>814
str =
(
)

ptn := "(abc-def-ghi-\d{n})"
RegExReplace(str, "abc-def-ghi-\d{n}", "", cnt)
RegExMatch(str, "O)" Refrain(ptn, cnt, ".+"), $)
Loop, % $.Count()
 ret .= (A_Index = 1 ? "" : "`n") . $.Value(A_Index)
;Sort, rtn
MsgBox, %ret%

Refrain(str, cnt, delim:="") {
 Loop, % --cnt
  tmp .= delim str
return str .= tmp
}