Regular Expressions 101

Save & Share

  • Regex Version: ver. 52
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

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]
  • 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
No Match

/
/
g

Test String

Substitution

Processing...

Code Generator

Generated Code

#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox Local $sRegex = "(?<="aspectRatio"\:\s\")\d+:\d+" Local $sString = "{" & @CRLF & _ " "timeline": {" & @CRLF & _ " "background": "#---secondaryColor---"," & @CRLF & _ " "fonts": [" & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Arial-Black.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Arial-BoldItalicMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Arial-BoldMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Arial-ItalicMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Arial.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/ArialNarrow-Bold.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/ArialNarrow-BoldItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/ArialNarrow-Italic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/ArialNarrow.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Caveat-Regular.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Georgia-Bold.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Georgia-BoldItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Georgia-Italic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Georgia.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-Black.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-BlackItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-Bold.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-BoldItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-ExtraBold.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-ExtraBoldItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-ExtraLight.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-ExtraLightItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-Italic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-Light.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-LightItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-Regular.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-SemiBold.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/Nunito-SemiBoldItalic.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/TimesNewRomanPS-BoldItalicMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/TimesNewRomanPS-BoldMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/TimesNewRomanPS-ItalicMT.ttf"" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/fonts/TimesNewRomanPSMT.ttf"" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "tracks": [" & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p>---eventName---</p><p class='date'>---openHouseDate---</p>"," & @CRLF & _ " "css": "p {font-family: '---primaryFont---'; text-align: center; ---primaryFontStyle---; color: #---secondaryColor---; font-size: 90px; line-height: 80%;} .date {font-size: 40px}"," & @CRLF & _ " "width": 1080," & @CRLF & _ " "height": 200" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "top"," & @CRLF & _ " "offset": {" & @CRLF & _ " "y": 0.02" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p class='address'>---propertyAddress---</p><p>---bedAmount--- Bed | ---bathAmount--- Bath</p><p>---propertySurface---</p><p>---currentPrice---</p>"," & @CRLF & _ " "css": "p {color: #---primaryColor---; text-align: center; font-size: 40px; ---primaryFontStyle---; font-family: '---primaryFont---'; line-height: 80%;} .address {font-size: 60px}"," & @CRLF & _ " "width": 980," & @CRLF & _ " "height": 320," & @CRLF & _ " "background": "#---secondaryColor---"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "bottom"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "luma"," & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/luma/Template31-22-1080x1350.jpg"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<div></div>"," & @CRLF & _ " "background": "#---primaryColor---"," & @CRLF & _ " "width": 1080," & @CRLF & _ " "height": 1350" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "center"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p></p>"," & @CRLF & _ " "width": 95," & @CRLF & _ " "height": 695," & @CRLF & _ " "background": "#---secondaryColor---"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "bottomLeft"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p></p>"," & @CRLF & _ " "width": 95," & @CRLF & _ " "height": 695," & @CRLF & _ " "background": "#---secondaryColor---"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "bottomRight"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "image"," & @CRLF & _ " "src": "---propertyPhoto1---"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "bottom"," & @CRLF & _ " "fit": "crop"," & @CRLF & _ " "scale": 0.8," & @CRLF & _ " "transition": {" & @CRLF & _ " "in": "carouselUpSlow"" & @CRLF & _ " }," & @CRLF & _ " "offset": {" & @CRLF & _ " "y---horizontalPhoto1---": 0.24," & @CRLF & _ " "y---verticalPhoto1---": 0.15" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p></p>"," & @CRLF & _ " "width": 1080," & @CRLF & _ " "height": 655," & @CRLF & _ " "background": "#---primaryColor---"" & @CRLF & _ " }," & @CRLF & _ " "start": 0," & @CRLF & _ " "length": 4," & @CRLF & _ " "position": "top"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p>---callToAction---</p>"," & @CRLF & _ " "css": "p {color: #000000; font-size: 58px; ---secondaryFontStyle---; font-family: '---secondaryFont---'}"," & @CRLF & _ " "width": 900," & @CRLF & _ " "height": 200" & @CRLF & _ " }," & @CRLF & _ " "start": 4," & @CRLF & _ " "length": 3," & @CRLF & _ " "position": "top"," & @CRLF & _ " "transition": {" & @CRLF & _ " "in": "fade"" & @CRLF & _ " }" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<p class='big'>---agentFirstName--- ---agentLastName---</p><p>---agentTitle---</p><p>---agentEmail---</p><p>---agentPhone---</p><p class='small'><br />---agentFirmName---<br />---agentFirmAddress---<br />---agentFirmWebsite---</p>"," & @CRLF & _ " "css": "p {color: #000000; font-size: 30px; ---secondaryFontStyle---; font-family: '---secondaryFont---'; margin-top: 0; margin-bottom: 0} .big {font-size: 58px} .small {font-size: 24px}"," & @CRLF & _ " "width": 900," & @CRLF & _ " "height": 540" & @CRLF & _ " }," & @CRLF & _ " "start": 4," & @CRLF & _ " "length": 3," & @CRLF & _ " "position": "bottom"," & @CRLF & _ " "offset": {" & @CRLF & _ " "y": 0.02" & @CRLF & _ " }," & @CRLF & _ " "transition": {" & @CRLF & _ " "in": "fade"" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "luma"," & @CRLF & _ " "src": "https://perry-template-assets.s3.us-east-2.amazonaws.com/luma/circle-1080x1350agent.jpg"" & @CRLF & _ " }," & @CRLF & _ " "start": 4," & @CRLF & _ " "length": 3" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "html"," & @CRLF & _ " "html": "<div></div>"," & @CRLF & _ " "background": "#D9---secondaryColor---"," & @CRLF & _ " "width": 1080," & @CRLF & _ " "height": 1350" & @CRLF & _ " }," & @CRLF & _ " "start": 4," & @CRLF & _ " "length": 3," & @CRLF & _ " "position": "center"" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }," & @CRLF & _ " {" & @CRLF & _ " "clips": [" & @CRLF & _ " {" & @CRLF & _ " "asset": {" & @CRLF & _ " "type": "image"," & @CRLF & _ " "src": "---agentPhoto---"" & @CRLF & _ " }," & @CRLF & _ " "start": 4," & @CRLF & _ " "length": 3," & @CRLF & _ " "fit": "crop"," & @CRLF & _ " "scale---horizontalAgentPhoto---": 0.5," & @CRLF & _ " "scale---verticalAgentPhoto---": 0.6," & @CRLF & _ " "position": "top"," & @CRLF & _ " "offset": {" & @CRLF & _ " "y---horizontalAgentPhoto---": -0.12," & @CRLF & _ " "y---verticalAgentPhoto---": -0.135" & @CRLF & _ " }," & @CRLF & _ " "transition": {" & @CRLF & _ " "in": "fadeFast"" & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }" & @CRLF & _ " ]," & @CRLF & _ " "cache": true" & @CRLF & _ " }," & @CRLF & _ " "output": {" & @CRLF & _ " "format": "mp4"," & @CRLF & _ " "resolution": "1080"," & @CRLF & _ " "aspectRatio": "4:5"," & @CRLF & _ " "quality": "medium"," & @CRLF & _ " "poster": {" & @CRLF & _ " "capture": 2" & @CRLF & _ " }," & @CRLF & _ " "destinations": [" & @CRLF & _ " {" & @CRLF & _ " "provider": "shotstack"," & @CRLF & _ " "exclude": true" & @CRLF & _ " }" & @CRLF & _ " ]" & @CRLF & _ " }" & @CRLF & _ "}" Local $sSubst = "" Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst) MsgBox($MB_SYSTEMMODAL, "Result", $sResult)

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