#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\|poke\|p([1,2])\|(.+?)(,|\|)"
Local $sString = "|poke|p1|Volcarona, M|" & @CRLF & _
"|poke|p1|Urshifu-*, F|" & @CRLF & _
"|poke|p1|Magnezone|" & @CRLF & _
"|poke|p1|Tangrowth, M|" & @CRLF & _
"|poke|p1|Corviknight, F|" & @CRLF & _
"|poke|p1|Hippowdon, F|" & @CRLF & _
"|poke|p2|Togekiss, M|" & @CRLF & _
"|poke|p2|Kommo-o, M|" & @CRLF & _
"|poke|p2|Jirachi|" & @CRLF & _
"|poke|p2|Mimikyu, F|" & @CRLF & _
"|poke|p2|Dragalge, F|" & @CRLF & _
"|poke|p1|Dragapult, F|" & @CRLF & _
"|poke|p1|Hatterene, F|" & @CRLF & _
"|poke|p1|Flygon, F|" & @CRLF & _
"|poke|p1|Inteleon, F|" & @CRLF & _
"|poke|p1|Obstagoon, F|" & @CRLF & _
"|poke|p1|Arcanine, F|" & @CRLF & _
"|poke|p2|Pincurchin, F|" & @CRLF & _
"|poke|p2|Magnezone|" & @CRLF & _
"|poke|p2|Hawlucha, F|" & @CRLF & _
"|poke|p2|Raichu-Alola, M|" & @CRLF & _
"|poke|p2|Ferrothorn, M|" & @CRLF & _
"|poke|p2|Magearna-Original|" & @CRLF & _
"|poke|p1|Slowbro, M|" & @CRLF & _
"|poke|p1|Tangrowth, F|" & @CRLF & _
"|poke|p1|Crawdaunt, F|" & @CRLF & _
"|poke|p1|Dragapult, M|" & @CRLF & _
"|poke|p1|Clefable, M|" & @CRLF & _
"|poke|p1|Excadrill, M|" & @CRLF & _
"|poke|p2|Togekiss, F|" & @CRLF & _
"|poke|p2|Starmie|" & @CRLF & _
"|poke|p2|Urshifu-*, M|" & @CRLF & _
"|poke|p2|Amoonguss, M|" & @CRLF & _
"|poke|p2|Cinderace, F|" & @CRLF & _
"|poke|p2|Jirachi|"
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