#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)^@([^{]+)\{([^,]+),\s*$|^\s*([^\R@=]+) = \{(.*?)}"
Local $sString = "@BOOK{ko," & @CRLF & _
" title = {Wissenschaftlich schreiben leicht gemacht}," & @CRLF & _
" publisher = {Haupt}," & @CRLF & _
" year = {2011}," & @CRLF & _
" author = {Kornmeier, M.}," & @CRLF & _
" number = {3154}," & @CRLF & _
" series = {UTB}," & @CRLF & _
" address = {Bern}," & @CRLF & _
" edition = {4}," & @CRLF & _
" subtitle = {für Bachelor, Master und Dissertation}" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"@BOOK{nial," & @CRLF & _
" title = {Wissenschaftliche Arbeiten schreiben mit Word 2010}," & @CRLF & _
" publisher = {Addison Wesley}," & @CRLF & _
" year = {2011}," & @CRLF & _
" author = {Nicol, N. and Albrecht, R.}," & @CRLF & _
" address = {München}," & @CRLF & _
" edition = {7}" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"@ARTICLE{shome," & @CRLF & _
" author = {Scholz, S. and Menzl, S.}," & @CRLF & _
" title = {Alle Wege führen nach Rom}," & @CRLF & _
" journal = {Medizin Produkte Journal}," & @CRLF & _
" year = {2011}," & @CRLF & _
" volume = {18}," & @CRLF & _
" pages = {243-254}," & @CRLF & _
" subtitle = {ein Vergleich der regulatorischen Anforderungen und Medizinprodukte" & @CRLF & _
" in Europa und den USA}," & @CRLF & _
" issue = {4}" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"@INBOOK{shu," & @CRLF & _
" author = {Schulz, C.}," & @CRLF & _
" title = {Corporate Finance für den Mittelstand}," & @CRLF & _
" booktitle = {Praxishandbuch Firmenkundengeschäft}," & @CRLF & _
" year = {2010}," & @CRLF & _
" editor = {Hilse, J. and Netzel, W and Simmert, D.B.}," & @CRLF & _
" booksubtitle = {Geschäftsfelder Risikomanagement Marketing}," & @CRLF & _
" publisher = {Gabler}," & @CRLF & _
" pages = {97-107}," & @CRLF & _
" location = {Wiesbaden}" & @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