#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?:#JSGF) (?<version>V1.0) (?<encoding>[A-Z-0-9]+) (?<locale>[a-z]{2}-[A-Z]{2});$"
Local $sString = "#JSGF V1.0 UTF-8 hu-HU;" & @CRLF & _
"grammar planmaster.hu;" & @CRLF & _
"<command_change_odontogram> = ( <change_to> [ a ] <odontogram_mode> [ felvételére | felvételre ] ) | ( <odontogram_mode> felvétele ) ;" & @CRLF & _
"<change_to> = ( váltás | válts | menj | ugrás | ugorj ) ;" & @CRLF & _
"<odontogram_mode> = ( státuszra | státuszhoz | státusz ) {state} | ( kezelés | kezelésre | kezeléshez | lépésekre | lépésekhez ) {treatment} ;" & @CRLF & _
"<command_full_jaw> = <all> * ( alsó {lower} | felső {upper} ) [ fogsor | állkapocs | fogak | fog ] <all> * <status> ;" & @CRLF & _
"<all> = mind | összes | teljes ;" & @CRLF & _
"<status> = ( <status1> | <status2> | <status3> ) {status} ;" & @CRLF & _
"<status1> = ( ép | alaphelyzet | alaphelyzetbe ) {1} ;" & @CRLF & _
"<status2> = ( hiány | hiányzik ) {2} ;" & @CRLF & _
"<status3> = [ szekunder ] ( szuvas | szuvasodott | szuvasodás ) {3} ;" & @CRLF & _
"<tooth18> = ( 18as | 18-as | tizennyolcas | nyolcas | ( 18 as ) ) {18} ;" & @CRLF & _
"<tooth17> = ( 17es | 17-es | tizenhetes | hetes | ( 17 es ) ) {17} ;" & @CRLF & _
"<tooth16> = ( 16os | 16-os | tizenhatos | hatos ) {16} ;" & @CRLF & _
"<tooth_region> = ( bal {left} | jobb {right} ) ( felső {upper} | alsó {lower} ) ;" & @CRLF & _
"<tooth_number> = ( <tooth18> | <tooth17> | <tooth16> | és ) ;" & @CRLF & _
"<command_select> = ( ( <tooth_number> + ) | <tooth_region> <tooth_number> + ) [ fog | fogak ] ;" & @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