#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(X(-?\d+(?:\.\d+)?))?\s*(Y(-?\d+(?:\.\d+)?))?"
Local $sString = "N14 X411 Y279.05" & @CRLF & _
"N15 G2 X33 Y280.4 I.001 J4.00" & @CRLF & _
"N16 G1 X408 Y280.4" & @CRLF & _
"N17 G2 X402.3 Y280.09 I-3 J2.65" & @CRLF & _
"N18 G1 X402.3 Y280.09" & @CRLF & _
"N19 G2 X402.09 Y285.79 I2.7 J2.95" & @CRLF & _
"N20 G1 X402.09 Y285.79" & @CRLF & _
"N3 G40 Y6000" & @CRLF & _
"N3 G40 X-6000"
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