#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(^ (?<Desc>[\s\S]*?) (?<QteComm>(?:[0-9]+)) (?<QteRecu>(?:[0-9]+)) (?<QteBO>(?:[0-9]*)) [$](?<PrixUnitaireF>(?:[0-9]+)\.(?:[0-9]+))[\s]+(?:(?<Escompte>(?:[0-9]+).(?:[0-9,]+)) %)?[\s]+(?<total_item>(?:[0-9]*[,]?[0-9]+)\.(?:[0-9]+))[\s]+[\r\n|\r|\n])"
Local $sString = "Date commandée Date de facture Commandé par Expédié par Votre numéro de commande" & @CRLF & _
"04-OCT-2022 05-DÉC-2022 LIVRE DIRECT 786q23teqwuye" & @CRLF & _
"Date d'expédition No. de compte No. Commis Notre No. commande" & @CRLF & _
"No. livraison manuel" & @CRLF & _
"05-DÉC-2022 358 MIB 21q24242456013" & @CRLF & _
"Quantité" & @CRLF & _
"Prix" & @CRLF & _
"No. Produit Description Escompte Montant" & @CRLF & _
"Commandé Livré unitaire" & @CRLF & _
"Souffrance" & @CRLF & _
"e e" & @CRLF & _
" 32_SSL-" & @CRLF & _
" PNI SSL-LH/480/20/40/287/DC/D 112 112 $73211.4800 8,022.44 " & @CRLF & _
"LHB3/170/40/120/3" & @CRLF & _
" 32_SSL- PNI AlloCie SSL-" & @CRLF & _
" 6 6 $2.2700 17.48 " & @CRLF & _
"LHB3/LV2/12V/CO LHB3/LV2/12V/CONTROLLER2" & @CRLF & _
" 32_SSL-" & @CRLF & _
" PNI AlloCie SSL-LH/LV/90V/SEN3erw2 175 175 $3.1100 4,044.25 " & @CRLF & _
"LH/LV/90V/SEN" & @CRLF & _
" livrer direct ref: s245354-5235 " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
"SOUS-TOTAL $1,041.31 " & @CRLF & _
"TRANSPORT $0.00 " & @CRLF & _
"FRAIS DIVERS $0.00 " & @CRLF & _
"T.P.S. $151.07 " & @CRLF & _
"T.V.Q. $296.38 " & @CRLF & _
" " & @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