Save & Share

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Character class intersection
    [\w&&[^\d]]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression
Processing...

Test String

Code Generator

Generated Code

#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