#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?P<command>\w{1,})(\s?-\s?(?P<description>.*))?"
Local $sString = "avvisi" & @CRLF & _
"calcola - Evaluate one or more algebric expressions" & @CRLF & _
"caratteri - Count the characters in a text message (use it in reply)" & @CRLF & _
"ciclopi - CiloPi stations status" & @CRLF & _
"coop - Get UniCoop Firenze opening hours for Pisa Cisanello shop" & @CRLF & _
"doodle - Manage doodle-type surveys" & @CRLF & _
"help - Help" & @CRLF & _
"language - Change language settings" & @CRLF & _
"monitor - Monitor a web page and notify changes" & @CRLF & _
"note - Save up to 10 notes, callable via inline query" & @CRLF & _
"ping - Check if bot is online" & @CRLF & _
"quando - Get the original sending datetime for a message (use it in reply)" & @CRLF & _
"reminder - Set a reminder" & @CRLF & _
"suggestion - Send a suggestion to help improve the bot" & @CRLF & _
"tastiera - Send a keyboard with bot commands" & @CRLF & _
"ciaone" & @CRLF & _
"ciaone - fdfdf" & @CRLF & _
"della - f"
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