#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<entry>@(\w+)\{(\w+),(?<kvp>\W*([a-zA-Z]+) = \{(.+)\},)(?&kvp)*(\W*([a-zA-Z]+) = \{(.+)\})\W*\},?\s*)(?&entry)*"
Local $sString = "@article{Gettys90," & @CRLF & _
" author = {Jim Gettys and Phil Karlton and Scott McGregor}," & @CRLF & _
" abstract = {A technical overview of the X11 functionality. This is an update of the X10 TOG paper by Scheifler \& Gettys.}," & @CRLF & _
" journal = {Software Practice and Experience}," & @CRLF & _
" volume = {20}," & @CRLF & _
" number = {S2}," & @CRLF & _
" title = {The {X} Window System, Version 11}," & @CRLF & _
" year = {1990}" & @CRLF & _
"}," & @CRLF & _
"" & @CRLF & _
"@article{Gettys90," & @CRLF & _
" author = {Jim Gettys and Phil Karlton and Scott McGregor}," & @CRLF & _
" abstract = {A technical overview of the X11 functionality. This is an update of the X10 TOG paper by Scheifler \& Gettys.}," & @CRLF & _
" journal = {Software Practice and Experience}," & @CRLF & _
" volume = {20}," & @CRLF & _
" number = {S2}," & @CRLF & _
" title = {The {X} Window System, Version 11}," & @CRLF & _
" year = {1990}" & @CRLF & _
"}," & @CRLF & _
"" & @CRLF & _
"@article{Gettys90," & @CRLF & _
" author = {Jim Gettys and Phil Karlton and Scott McGregor}," & @CRLF & _
" abstract = {A technical overview of the X11 functionality. This is an update of the X10 TOG paper by Scheifler \& Gettys.}," & @CRLF & _
" journal = {Software Practice and Experience}," & @CRLF & _
" volume = {20}," & @CRLF & _
" number = {S2}," & @CRLF & _
" title = {The {X} Window System, Version 11}," & @CRLF & _
" year = {1990}" & @CRLF & _
"}"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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