#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)(\d+?[\+x])?\d+ ?(litros?|u(ni)?ds?|kg|g|cl)(.?, \w+ \d+ ?(litros?|u(ni)?ds|kg|g))?"
Local $sString = "Aceite de oliva virgen extra CARBONELL, garrafa 3 litros" & @CRLF & _
"Aceite de oliva virgen CARBONELL, botella 1 litro" & @CRLF & _
"First Bike, bici sin pedales roja,edad rec:2-5 años CHICCO, peso máximo 25 Kg" & @CRLF & _
"Bombón de almendras MAGNUM, 3+1 uds., caja 423 g" & @CRLF & _
"Bote PLAY-DOH,pasta de moldear, sutidos sorpresa, edad rec:+2 años, pack 4uds" & @CRLF & _
"Magdalena 0% azúcar LA BELLA EASO, 8 unid., paquete 232 g" & @CRLF & _
"Magdalena 0% azúcar LA BELLA EASO, 8 unid., paquete 232 g" & @CRLF & _
"Cerveza MAHOU 5 Estrellas, pack botellín 12x25 cl" & @CRLF & _
"Bote PLAY-DOH,pasta de moldear, sutidos sorpresa, edad rec:+2 años, pack 4uds"
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