Regular Expressions 101

Save & Share

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

r"
"
g

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 = "([a-z]+\.){2,}[a-z]+" Local $sString = "# 🧩 ReVanced Patches" & @CRLF & _ "" & @CRLF & _ "Official patches by ReVanced" & @CRLF & _ "" & @CRLF & _ "## 📜 List of available patches" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.twitter.android`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `timeline-ads` | Removes ads from the Twitter timeline. | all |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.reddit.frontpage`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.garzotto.pflotsh.ecmwf_a`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `pflotsh-ecmwf-subscription-unlock` | Unlocks all subscription features. | 3.5.4 |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.google.android.apps.youtube.music`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.17.51 |" & @CRLF & _ "| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.16.51 |" & @CRLF & _ "| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.17.51 |" & @CRLF & _ "| `compact-header` | Hides the music category bar at the top of the homepage. | 5.16.51 |" & @CRLF & _ "| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.17.51 |" & @CRLF & _ "| `background-play` | Enables playing music in the background. | 5.17.51 |" & @CRLF & _ "| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.17.51 |" & @CRLF & _ "| `music-video-ads` | Removes ads in the music player. | 5.17.51 |" & @CRLF & _ "| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.17.51 |" & @CRLF & _ "| `exclusive-audio-playback` | Enables the option to play music without video. | 5.17.51 |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `de.dwd.warnapp`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.ss.android.ugc.trill`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `tiktok-ads` | Removes ads from TikTok. | all |" & @CRLF & _ "</details>" & @CRLF & _ "" & @CRLF & _ "### 📦 `com.google.android.youtube`" & @CRLF & _ "<details>" & @CRLF & _ "" & @CRLF & _ "| 💊 Patch | 📜 Description | 🏹 Target Version |" & @CRLF & _ "|:--------:|:--------------:|:-----------------:|" & @CRLF & _ "| `swipe-controls` | Adds volume and brightness swipe controls. | 17.29.34 |" & @CRLF & _ "| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.29.34 |" & @CRLF & _ "| `minimized-playback` | Enables minimized and background playback. | 17.29.34 |" & @CRLF & _ "| `amoled` | Enables pure black theme. | 17.29.34 |" & @CRLF & _ "| `disable-create-button` | Hides the create button in the navigation bar. | 17.29.34 |" & @CRLF & _ "| `hide-cast-button` | Hides the cast button in the video player. | all |" & @CRLF & _ "| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.29.34 |" & @CRLF & _ "| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.29.34 |" & @CRLF & _ "| `premium-heading` | Shows premium branding on the home screen. | all |" & @CRLF & _ "| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |" & @CRLF & _ "| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.29.34 |" & @CRLF & _ "| `old-quality-layout` | Enables the original quality flyout menu. | 17.29.34 |" & @CRLF & _ "| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.29.34 |" & @CRLF & _ "| `hide-watermark` | Hides creator's watermarks on videos. | 17.29.34 |" & @CRLF & _ "| `sponsorblock` | Integrate SponsorBlock. | 17.29.34 |" & @CRLF & _ "| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.29.34 |" & @CRLF & _ "| `tablet-mini-player` | Enables the tablet mini player layout. | 17.29.34 |" & @CRLF & _ "| `custom-video-buffer` | Lets you change the buffers of videos. | 17.29.34 |" & @CRLF & _ "| `always-autorepeat` | Always repeats the playing video again. | 17.29.34 |" & @CRLF & _ "| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG | 17.29.34 |" & @CRLF & _ "| `settings` | Adds settings for ReVanced to YouTube. | all |" & @CRLF & _ "| `enable-debugging` | Enables app debugging by patching the manifest file. | all |" & @CRLF & _ "| `custom-playback-speed` | Adds more video playback speed options. | 17.29.34 |" & @CRLF & _ "| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.29.34 |" & @CRLF & _ "| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.29.34 |" & @CRLF & _ "| `video-ads` | Removes ads in the video player. | 17.29.34 |" & @CRLF & _ "| `general-ads` | Removes general ads. | 17.29.34 |" & @CRLF & _ "| `hide-infocard-suggestions` | Hides infocards in videos. | 17.29.34 |" & @CRLF & _ "</details>" & @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