#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<script([\s\S]*?)>([\s\S]*?)<\/script>"
Local $sString = "<template>" & @CRLF & _
" <div :class="classObj" class="app-wrapper">" & @CRLF & _
" <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />" & @CRLF & _
" <sidebar class="sidebar-container" />" & @CRLF & _
" <div :class="{hasTagsView:needTagsView}" class="main-container">" & @CRLF & _
" <div :class="{'fixed-header':fixedHeader}">" & @CRLF & _
" <navbar />" & @CRLF & _
" <tags-view v-if="needTagsView" />" & @CRLF & _
" </div>" & @CRLF & _
" <app-main />" & @CRLF & _
" <right-panel v-if="showSettings">" & @CRLF & _
" <settings />" & @CRLF & _
" </right-panel>" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
"</template>" & @CRLF & _
"" & @CRLF & _
"<script>" & @CRLF & _
"import RightPanel from '@/components/RightPanel'" & @CRLF & _
"import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'" & @CRLF & _
"import ResizeMixin from './mixin/ResizeHandler'" & @CRLF & _
"import { mapState } from 'vuex'" & @CRLF & _
"" & @CRLF & _
"export default {" & @CRLF & _
" name: 'Layout'," & @CRLF & _
" components: {" & @CRLF & _
" AppMain," & @CRLF & _
" Navbar," & @CRLF & _
" RightPanel," & @CRLF & _
" Settings," & @CRLF & _
" Sidebar," & @CRLF & _
" TagsView" & @CRLF & _
" }," & @CRLF & _
" mixins: [ResizeMixin]," & @CRLF & _
" computed: {" & @CRLF & _
" ...mapState({" & @CRLF & _
" sidebar: state => state.app.sidebar," & @CRLF & _
" device: state => state.app.device," & @CRLF & _
" showSettings: state => state.settings.showSettings," & @CRLF & _
" needTagsView: state => state.settings.tagsView," & @CRLF & _
" fixedHeader: state => state.settings.fixedHeader" & @CRLF & _
" })," & @CRLF & _
" classObj() {" & @CRLF & _
" return {" & @CRLF & _
" hideSidebar: !this.sidebar.opened," & @CRLF & _
" openSidebar: this.sidebar.opened," & @CRLF & _
" withoutAnimation: this.sidebar.withoutAnimation," & @CRLF & _
" mobile: this.device === 'mobile'" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
" }," & @CRLF & _
" methods: {" & @CRLF & _
" handleClickOutside() {" & @CRLF & _
" this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
"}" & @CRLF & _
"</script>" & @CRLF & _
"" & @CRLF & _
"<style lang="scss" scoped>" & @CRLF & _
" @import "~@/styles/mixin.scss";" & @CRLF & _
" @import "~@/styles/variables.scss";" & @CRLF & _
"" & @CRLF & _
" .app-wrapper {" & @CRLF & _
" @include clearfix;" & @CRLF & _
" position: relative;" & @CRLF & _
" height: 100%;" & @CRLF & _
" width: 100%;" & @CRLF & _
"" & @CRLF & _
" &.mobile.openSidebar {" & @CRLF & _
" position: fixed;" & @CRLF & _
" top: 0;" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" .drawer-bg {" & @CRLF & _
" background: #000;" & @CRLF & _
" opacity: 0.3;" & @CRLF & _
" width: 100%;" & @CRLF & _
" top: 0;" & @CRLF & _
" height: 100%;" & @CRLF & _
" position: absolute;" & @CRLF & _
" z-index: 999;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" .fixed-header {" & @CRLF & _
" position: fixed;" & @CRLF & _
" top: 0;" & @CRLF & _
" right: 0;" & @CRLF & _
" z-index: 9;" & @CRLF & _
" width: calc(100% - #{$sideBarWidth});" & @CRLF & _
" transition: width 0.28s;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" .hideSidebar .fixed-header {" & @CRLF & _
" width: calc(100% - 54px)" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" .mobile .fixed-header {" & @CRLF & _
" width: 100%;" & @CRLF & _
" }" & @CRLF & _
"</style>"
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