#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:(?:import|export)[^`'"]*from\s+[`'"])(?<from>[^`'"./][^`'"]*)(?:[`'"])|(?:\bimport)(?:\s+|\s*\(\s*)(?:[`'"])(?<plain>[^`'"./][^`'"]*)(?:[`'"])"
Local $sString = "import { defaultTemplateProcessor } from './lib/default-template-processor.js';" & @CRLF & _
"import { SVGTemplateResult, TemplateResult } from './lib/template-result.js';" & @CRLF & _
"export { DefaultTemplateProcessor, defaultTemplateProcessor } from './lib/default-template-processor.js';" & @CRLF & _
"export { directive, isDirective } from './lib/directive.js';" & @CRLF & _
"export { removeNodes, reparentNodes } from './lib/dom.js';" & @CRLF & _
"export { noChange, nothing } from './lib/part.js';" & @CRLF & _
"export { AttributeCommitter, AttributePart, BooleanAttributePart, EventPart, isIterable, isPrimitive, NodePart, PropertyCommitter, PropertyPart } from './lib/parts.js';" & @CRLF & _
"export { parts, render } from './lib/render.js';" & @CRLF & _
"export { templateCaches, templateFactory } from './lib/template-factory.js';" & @CRLF & _
"export { TemplateInstance } from './lib/template-instance.js';" & @CRLF & _
"export { SVGTemplateResult, TemplateResult } from './lib/template-result.js';" & @CRLF & _
"export { createMarker, isTemplatePartActive, Template } from './lib/template.js';" & @CRLF & _
"import { render } from 'lit-html/lib/shady-render.js';" & @CRLF & _
"import { UpdatingElement } from './lib/updating-element.js';" & @CRLF & _
"export * from './lib/updating-element.js';" & @CRLF & _
"export * from './lib/decorators.js';" & @CRLF & _
"export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html.js';" & @CRLF & _
"import { supportsAdoptingStyleSheets } from './lib/css-tag.js';" & @CRLF & _
"export * from './lib/css-tag.js';" & @CRLF & _
"import { LitElement } from 'lit-element';" & @CRLF & _
"import { IronMeta } from '@polymer/iron-meta/iron-meta.js';" & @CRLF & _
"import { whenOnline } from 'hadron-core/lib/utils/async.js';" & @CRLF & _
"import { apiUrl, apiVersion } from '../../src/config.js';" & @CRLF & _
"import { importModule, dynamicImportAvailable } from '../../src/dynamic-imports-polyfill.js';" & @CRLF & _
"import observeProperties from 'hadron-core/lib/utils/object-property-observer.js';" & @CRLF & _
"export { version };" & @CRLF & _
"import { ElementMixin, version } from './lib/mixins/element-mixin.js';" & @CRLF & _
"export { html } from './lib/utils/html-tag.js';" & @CRLF & _
"" & @CRLF & _
"class Foo {" & @CRLF & _
"" & @CRLF & _
" constructor() {" & @CRLF & _
" import(`foo.js`);" & @CRLF & _
" import(`${foo}`);" & @CRLF & _
" import('bar.js');" & @CRLF & _
" } " & @CRLF & _
"" & @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