#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<=^|[\n;](?:[\t ]*(?:\w+ )?)?)export(?:(?:\s+(?<type>type)\s*)|\s*)(?<exports>{[\w\t\n\r "$'*,./{}-]+?})(?=;?[\t\n;]*?(?!(?:\n*\/\/)|(?:\n*\/\*)|(?:\s*from.*?)))"
Local $sString = "export { name1, /* */ nameN };" & @CRLF & _
"export { variable1 as name1, variable2 as name2, /* */ nameN };" & @CRLF & _
"export { variable1 as "string name" };" & @CRLF & _
"export { name1 as default /*, */ };" & @CRLF & _
"export type { CompilerOptionsJson as default };" & @CRLF & _
"export { default }" & @CRLF & _
"export { " & @CRLF & _
" DEFAULTS," & @CRLF & _
" plugin as default," & @CRLF & _
" type Options" & @CRLF & _
"}" & @CRLF & _
"export type { Config, Result }" & @CRLF & _
"export type { default as Options }" & @CRLF & _
"" & @CRLF & _
"export { default } from './make'" & @CRLF & _
"export { " & @CRLF & _
" DEFAULTS," & @CRLF & _
" plugin as default," & @CRLF & _
" type Options" & @CRLF & _
"} from './plugin'" & @CRLF & _
"export type { Config, Result } from './interfaces'" & @CRLF & _
"export type { default as Options } from './options'" & @CRLF & _
"" & @CRLF & _
"var g;export{name1};export{name1}" & @CRLF & _
"var g;export{name1}; export{name1}" & @CRLF & _
"export { name1, /* */ nameN }" & @CRLF & _
"export { import1 as ", import2 as name2, /* */ nameN }" & @CRLF & _
"export { default, /* */ }" & @CRLF & _
"" & @CRLF & _
"declare module 'module-name' {" & @CRLF & _
" export { " & @CRLF & _
" DEFAULTS," & @CRLF & _
" plugin as default," & @CRLF & _
" type Options" & @CRLF & _
" }" & @CRLF & _
" export type { Config, Result }" & @CRLF & _
" export type { default as Options }" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"export { default } from './make'" & @CRLF & _
"export { " & @CRLF & _
" DEFAULTS," & @CRLF & _
" plugin as default," & @CRLF & _
" type Options" & @CRLF & _
"} from './plugin'" & @CRLF & _
"export type { Config, Result } from './interfaces'" & @CRLF & _
"export type { default as Options } from './options'" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"// export { default }" & @CRLF & _
"" & @CRLF & _
"// export type { default as Statement }" & @CRLF & _
"" & @CRLF & _
"/**" & @CRLF & _
" * @example" & @CRLF & _
" * export { default }" & @CRLF & _
" * export { Config, Result }" & @CRLF & _
" * export type { default as Options }" & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"export { default, /* */ }"
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