Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • 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

/
/
gm

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)(?siU)var tc = '([a-zA-Z0-9]*)'(?:.*)_token": "([\w]*)"(?:.*)slice\(([\d,]*)\)" Local $sString = "" & @CRLF & _ "<!DOCTYPE html>" & @CRLF & _ "<html lang="en">" & @CRLF & _ "<head>" & @CRLF & _ " <meta charset="UTF-8">" & @CRLF & _ " <meta name="viewport" content="width=device-width, initial-scale=1.0">" & @CRLF & _ " <link rel="shortcut icon" type="image/x-icon" href="https://123moviesplayer.com/public/images/favicon.png">" & @CRLF & _ " <meta name="robots" content="noindex">" & @CRLF & _ " <title>The Good Doctor - PutStream</title>" & @CRLF & _ " <meta name="title" content="The Good Doctor - PutStream"/>" & @CRLF & _ " <meta name="description" content=" - PutStream"/>" & @CRLF & _ " <meta property="og:title" content="The Good Doctor - PutStream"/>" & @CRLF & _ " <meta property="og:description" content=" - PutStream"/>" & @CRLF & _ " <meta property="og:keywords" content=" - PutStream"/>" & @CRLF & _ " <meta property="og:image:height" content="350"/>" & @CRLF & _ " <meta property="og:image:width" content="650"/>" & @CRLF & _ " <meta property="og:image" content=""/>" & @CRLF & _ " " & @CRLF & _ "" & @CRLF & _ " <link href="https://123moviesplayer.com/dsPlayer/player.css" rel="stylesheet">" & @CRLF & _ " <script data-cfasync="false" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>" & @CRLF & _ "" & @CRLF & _ " " & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<script data-cfasync="false" type="text/javascript" src="//puntoenun.site/rm4hSvDnGTSHIK8G/14151"></script>" & @CRLF & _ "<script data-cfasync="false" src="//d10lv7w3g0jvk9.cloudfront.net/?gwvld=813639"></script>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " " & @CRLF & _ "</head>" & @CRLF & _ "<body>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<div class="custom_loading_sign">" & @CRLF & _ " <img src="https://123images.co/curved-bars.svg" alt="">" & @CRLF & _ "</div>" & @CRLF & _ "<style>" & @CRLF & _ ".custom_loading_sign {background: #000 none repeat scroll 0 0; bottom: 0; left: 0; position: fixed; right: 0; text-align: center; top: 0; z-index: 99; }" & @CRLF & _ ".custom_loading_sign img {margin-top: -50px; margin-left: -50px; position: absolute; top: 50%; width: 100px; }" & @CRLF & _ ".cantskip {" & @CRLF & _ " bottom: 0%;" & @CRLF & _ " position: absolute;" & @CRLF & _ " right: 0%;" & @CRLF & _ "}" & @CRLF & _ ".adtimes {" & @CRLF & _ " bottom: 0%;" & @CRLF & _ " position: absolute;" & @CRLF & _ " left: 20%;" & @CRLF & _ "}" & @CRLF & _ "#timer {" & @CRLF & _ " right: 5px;" & @CRLF & _ " position: absolute;" & @CRLF & _ " color: white;" & @CRLF & _ "}" & @CRLF & _ "</style>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<iframe sandbox="allow-same-origin allow-popups allow-scripts allow-popups-to-escape-sandbox" id="openloadIframe" allowfullscreen="" webkitallowfullscreen="true" mozallowfullscreen="true" style="width:100%;height:100%;" src=""></iframe>" & @CRLF & _ "" & @CRLF & _ "<div class="player_area">" & @CRLF & _ " <div id="player">" & @CRLF & _ " " & @CRLF & _ " </div>" & @CRLF & _ " " & @CRLF & _ " " & @CRLF & _ "</div>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<script data-cfasync="false">" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "function openNew(links,mirror){" & @CRLF & _ " if(!mirror){ mirror = 'mirror4';}" & @CRLF & _ " $('.checkresume.clear').remove();" & @CRLF & _ " addRemoveClas(mirror);" & @CRLF & _ " $("div").removeClass("player_area");" & @CRLF & _ " $('#openloadIframe').attr('src', links);" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "function addRemoveClas(miror){" & @CRLF & _ " $(".alternativer ul li").removeClass('select-hold');" & @CRLF & _ " $(".alternativer ul li[data-value='"+miror+"']").addClass('select-hold');" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "function initializLinks(put_links){" & @CRLF & _ " " & @CRLF & _ " if(put_links[0] != -1){" & @CRLF & _ " openNew(put_links[0].file,'mirror1');" & @CRLF & _ " }else if(put_links[1] != -1){" & @CRLF & _ " openNew(put_links[1].file,'mirror2');" & @CRLF & _ " }else if(put_links[2] != -1){" & @CRLF & _ " openNew(put_links[2].file,'mirror3');" & @CRLF & _ " }else if(put_links[3] != -1){" & @CRLF & _ " openNew(put_links[3].file,'mirror4');" & @CRLF & _ " }else if(put_links[4] != -1){" & @CRLF & _ " openNew(put_links[4].file,'mirror5');" & @CRLF & _ " }else{" & @CRLF & _ " alert("no source available. please try after sometime!!");" & @CRLF & _ " }" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "function initializePlayer(links){" & @CRLF & _ " var put_links= [];" & @CRLF & _ " var opn = false;" & @CRLF & _ " var mirros = [];" & @CRLF & _ " var cn = 0;" & @CRLF & _ " var links = jQuery.parseJSON(links);" & @CRLF & _ " if(links.length!=0){" & @CRLF & _ " for (i = 0; i < links.length; ++i) {" & @CRLF & _ " var getLinks = links[i];" & @CRLF & _ " " & @CRLF & _ " if (getLinks.trim()) {" & @CRLF & _ " //console.log(getLinks);" & @CRLF & _ " " & @CRLF & _ " if (/gounlimited/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='gounlimited';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/\/vid\//i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='vid';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/\/vid1\//i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='vid1';" & @CRLF & _ " singleSrc.type='hls';" & @CRLF & _ " singleSrc.default=false;" & @CRLF & _ " }else if (/onlystream/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='onlystream';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/vcstream/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='vcstream';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/mightyupload/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='mightyupload';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/upstream/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='upstream';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/hqq.tv/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='hqqtv';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else if (/mightyupload/i.test(getLinks)) {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='mightyupload';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " }else {" & @CRLF & _ " var singleSrc={};" & @CRLF & _ " singleSrc.file=links[i];" & @CRLF & _ " singleSrc.label='gl';" & @CRLF & _ " singleSrc.type='mp4';" & @CRLF & _ " " & @CRLF & _ " }" & @CRLF & _ " if(singleSrc == -1){" & @CRLF & _ " mirros[i+1] = -1;" & @CRLF & _ " put_links[cn] = -1; cn++;" & @CRLF & _ " }else{" & @CRLF & _ " put_links.push(singleSrc);" & @CRLF & _ " mirros[i+1] = cn; cn++;" & @CRLF & _ " }" & @CRLF & _ " " & @CRLF & _ " }else{" & @CRLF & _ " mirros[i+1] = -1;" & @CRLF & _ " put_links[cn] = -1; cn++;" & @CRLF & _ " }" & @CRLF & _ " " & @CRLF & _ " }" & @CRLF & _ " }" & @CRLF & _ " " & @CRLF & _ " " & @CRLF & _ " if(opn){" & @CRLF & _ " //openNew(opn,'mirror1');" & @CRLF & _ " }else{" & @CRLF & _ " initializLinks(put_links);" & @CRLF & _ " }" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "$(document).ready(function(){" & @CRLF & _ " $('.custom_loading_sign').hide();" & @CRLF & _ " // $('.adtimes').hide();" & @CRLF & _ " linksgeter();" & @CRLF & _ " " & @CRLF & _ " });" & @CRLF & _ " " & @CRLF & _ "function linksgeter(){" & @CRLF & _ "" & @CRLF & _ " //$('.adtimes').show();" & @CRLF & _ " //$('.app-download').hide();" & @CRLF & _ " //$('.skipads').hide();" & @CRLF & _ " " & @CRLF & _ " // document.getElementById('timer').innerHTML = 00 + ":" + 30;" & @CRLF & _ " /// startTimer();" & @CRLF & _ " " & @CRLF & _ " //$('.cantskip').hide();" & @CRLF & _ " //$('#`player1`').hide();" & @CRLF & _ " //$('#adshow').hide();" & @CRLF & _ " $('#openloadIframe').show();" & @CRLF & _ " $('.player_area').show();" & @CRLF & _ " //$('.alternativer').height($('.alternativer ul').height()); " & @CRLF & _ " $('.custom_loading_sign').show();" & @CRLF & _ " var tc = 'bXFXbW9hVnJZV0Nub2FXbHBKYVRubUNsb1dDWG5wU1dsbDVrbUtsa21XUm9ZNmVVcUpKZ21hYWVucTJhcGFhaHBXdGhZR05qWlo2aHA1dVdwYUdla3F1V3BGK1ZvSjlncUpxV1lKZXFmR0dYaVhTZGU1dWhtcFo1aTVwK2RIeXJlNXVobW45MWY1cCtkSHlkZTV1aG1uK0ZmNXArZEh5aGxJaURtb0dhZkdHV2RZdGhnS3R6WVlDcm1acCtkSHlYZTV1aG1vQ0ZlNnQvbTVsamdJV0RZNENiaDJXQWhYZXJnWFdIWW51YXFacVdlR3VqaklobW1vR2FlMlovcTROaGdJV1ptcGlDWGwxWW42R2ZsNWFmazY2dG1xV21vYVZyWVdDYW9xTmZwcWRob1o2U3E1YWtZSmVlbEphV2tLS2RrNnFYbzJDaG1xRnhwNXVWYjRpZWc2S0dkNWlzaXArcGZvS3NlMmFFZG9PZGxXV0xlbjU2YzZlQ2htRnJWNU9tcHFDaW5aT3FiNStoclE9PQ';" & @CRLF & _ " $.ajax({ " & @CRLF & _ " type: "POST", url: "https://123moviesplayer.com/decoding_v3.php", " & @CRLF & _ " headers: { 'x-token': _tsd_tsd_ds(tc)}," & @CRLF & _ " data: {" & @CRLF & _ " 'tokenCode': tc," & @CRLF & _ " "_token": "lV3wAUeCfrSK80dAP3N2ge2pojJJrOcrjrWl2o9C"," & @CRLF & _ " }, " & @CRLF & _ " success: function(put_links) {" & @CRLF & _ " $('.custom_loading_sign').hide();" & @CRLF & _ " initializePlayer(put_links);" & @CRLF & _ " } " & @CRLF & _ " });" & @CRLF & _ "" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "function _tsd_tsd_ds(s) { var _76x80l = s;var _61rxx129 = _76x80l.slice(9,28);var _520fx33 = _39x759d(_61rxx129); var _1x70n = _O88xO4(_520fx33); return _12vx90(_1x70n) + "28"+"939459"; } function _39x759d(s){return s.split("");}function _O88xO4(r){return r.reverse();}function _12vx90(n){return n.join("");}</script>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<style>" & @CRLF & _ "body,html{background-color: #000;}" & @CRLF & _ ".player_area {bottom: 0 !important; left: 0; position: absolute; right: 0; top: 0; }" & @CRLF & _ ".jwplayer.jw-flag-aspect-mode {height: 100% !important; }" & @CRLF & _ ".jwplayer#player, body .jw-error {height: 100% !important; width: 100% !important; }" & @CRLF & _ ".jw-icon.jw-icon-tooltip.jw-icon-cc.jw-reset.jw-hidden {display: inline-block !important; }" & @CRLF & _ "</style>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<!-- upload custome subtitles -->" & @CRLF & _ "<script data-cfasync="false" src="https://123moviesplayer.com/dsPlayer/dropzone.js"></script>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<script data-cfasync="false">" & @CRLF & _ "$("<div class='alternativer'></div>").appendTo($("body"));" & @CRLF & _ "$(".alternativer").html('<span></span><ul><li class="select-hold" data-value="mirror1" onclick="changeSource(\'mirror1\'); return false">Mirror 1</li><li class="" data-value="mirror2" onclick="changeSource(\'mirror2\'); return false">Mirror 2</li><li class="" data-value="mirror3" onclick="changeSource(\'mirror3\'); return false">Mirror 3</li><li class="" data-value="mirror4" onclick="changeSource(\'mirror4\'); return false">Mirror 4</li><li class="" data-value="mirror5" onclick="changeSource(\'mirror5\'); return false">Mirror 5</li></ul>');" & @CRLF & _ "" & @CRLF & _ "if($("iframe").length==0) {" & @CRLF & _ " $(".alternativer ul").fadeIn()" & @CRLF & _ "}else $(".alternativer").css( { right:4,top:16 });" & @CRLF & _ "" & @CRLF & _ "$(".alternativer span").click(function(){" & @CRLF & _ " $(".alternativer ul").fadeToggle()" & @CRLF & _ "}" & @CRLF & _ ");" & @CRLF & _ "$(".vjs-tech").click(function() {" & @CRLF & _ " $('.alternativer ul').hide();" & @CRLF & _ "}" & @CRLF & _ ");" & @CRLF & _ "$(".vjs-poster").click(function() {" & @CRLF & _ " $('.alternativer ul').hide();" & @CRLF & _ "}" & @CRLF & _ ");" & @CRLF & _ "$('.alternativer ul li').click(function() {" & @CRLF & _ " $("*").removeClass("select-hold");" & @CRLF & _ " $(this).addClass('select-hold')" & @CRLF & _ "}" & @CRLF & _ ");" & @CRLF & _ "function changeSource(sourceIndex){" & @CRLF & _ " var currentmovieHerf='https://123moviesplayer.com/show/the-good-doctor/03-13?src='+sourceIndex;" & @CRLF & _ " window.location.replace(currentmovieHerf); return false;" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "$(document).ready(function(){" & @CRLF & _ " //$('.alternativer').height($('.alternativer ul').height()); " & @CRLF & _ "});" & @CRLF & _ "</script>" & @CRLF & _ "<style>" & @CRLF & _ ".alternativer ul li:hover, .alternativer ul li.select-hold {color: red; }" & @CRLF & _ ".alternativer {max-height: 160px; position: absolute; right: 15px; bottom: 225px; width: 110px; z-index: 999999 !important; }" & @CRLF & _ ".alternativer span {background: rgba(0, 0, 0, 0.55) none repeat scroll 0 0; border-radius: 0; box-shadow: 0 0 3px 1px #cfcbcb; cursor: pointer; display: block; float: right; height: 100%; opacity: 1; position: relative; text-align: center; width: 15px; z-index: 99; }" & @CRLF & _ ".alternativer ul {background: rgba(0, 0, 0, 0.55) none repeat scroll 0 0; color: #979797; float: left; font-size: 13px; left: 0; list-style-type: none; margin: 0; padding: 0; position: absolute; top: 0; width: 145px; }" & @CRLF & _ ".alternativer ul li {border-bottom: 1px solid red; border-radius: 0; box-sizing: border-box; color: #fff; cursor: pointer; font-size: 14px; font-style: normal; line-height: 16px; margin: 0; max-height: 36px; opacity: 0.9; padding: 5px 10px; text-align: left; width: 100%; }" & @CRLF & _ ".alternativer span::before {color: red; content: ">"; display: block; font-size: 12px; height: 10px; left: 1px; margin-top: -6px; opacity: 1; position: absolute; top: 50%; width: 100%; }" & @CRLF & _ ".vjs-control-bar{z-index: 99999999999999999999;}" & @CRLF & _ "</style>" & @CRLF & _ " " & @CRLF & _ " <!-- Histats.com START (aync)-->" & @CRLF & _ "<script type="text/javascript">var _Hasync= _Hasync|| [];" & @CRLF & _ "_Hasync.push(['Histats.start', '1,2793971,4,0,0,0,00010000']);" & @CRLF & _ "_Hasync.push(['Histats.fasi', '1']);" & @CRLF & _ "_Hasync.push(['Histats.track_hits', '']);" & @CRLF & _ "(function() {" & @CRLF & _ "var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;" & @CRLF & _ "hs.src = ('//s10.histats.com/js15_as.js');" & @CRLF & _ "(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);" & @CRLF & _ "})();</script> " & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " <!-- Global site tag (gtag.js) - Google Analytics -->" & @CRLF & _ "<script async src="https://www.googletagmanager.com/gtag/js?id=UA-153655914-1"></script>" & @CRLF & _ "<script>" & @CRLF & _ " window.dataLayer = window.dataLayer || [];" & @CRLF & _ " function gtag(){dataLayer.push(arguments);}" & @CRLF & _ " gtag('js', new Date());" & @CRLF & _ "" & @CRLF & _ " gtag('config', 'UA-153655914-1');" & @CRLF & _ "</script>" & @CRLF & _ "" & @CRLF & _ " " & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "</body>" & @CRLF & _ "</html>" 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