Regular Expressions 101

Save & Share

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

/
/
i

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 = "(?i)<a.+?href=("|\')(.+?)\1" Local $sString = "<!DOCTYPE html>" & @CRLF & _ "<html lang="en">" & @CRLF & _ " <head>" & @CRLF & _ " <meta charset="utf-8">" & @CRLF & _ " <meta http-equiv="X-UA-Compatible" content="IE=edge">" & @CRLF & _ " <meta name="viewport" content="width=device-width, initial-scale=1">" & @CRLF & _ " <meta charset="utf-8"/><meta content="http://www.AutoGenerateLink.com" property='og:url'/>" & @CRLF & _ " <meta name="description" content="Premium Link Generator Mega.co.nz, 4Shared, 1fichier, Tusfiles, Scribd, Soundcloud, Dailymotion, etc."/>" & @CRLF & _ " <meta name="keywords" content="premium link generator, uptobox, mega, 1fichier, 4shared"/>" & @CRLF & _ " <meta name="author" content="AutoGenerateLink.com"/>" & @CRLF & _ " <meta name="rating" content="general"/>" & @CRLF & _ " <meta name="distribution" content="global"/>" & @CRLF & _ " <meta name="copyright" content="www.autogeneratelink.com"/> " & @CRLF & _ " <meta name="alexaVerifyID" content="zCZAFdgRZuC8NRYtQg5Hm1JJOQg"/> " & @CRLF & _ " " & @CRLF & _ " <title>Premium Link Generator // AutoGenerateLink.com</title>" & @CRLF & _ " <link href="http://www.autogeneratelink.com/css/bootstrap.min.css" rel="stylesheet">" & @CRLF & _ " <link href="http://www.autogeneratelink.com/css/autogl.css" rel="stylesheet"> " & @CRLF & _ " <!--[if lt IE 9]>" & @CRLF & _ " <script src="http://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>" & @CRLF & _ " <script src="http://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>" & @CRLF & _ " <![endif]-->" & @CRLF & _ " <script src="http://www.autogeneratelink.com/js/jquery.min.js"></script> " & @CRLF & _ " <script src="http://www.autogeneratelink.com/js/yudamo-gl.js"></script> " & @CRLF & _ " <script src='https://www.google.com/recaptcha/api.js?hl=en'></script>" & @CRLF & _ "<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>" & @CRLF & _ "<script>" & @CRLF & _ " (adsbygoogle = window.adsbygoogle || []).push({" & @CRLF & _ " google_ad_client: "ca-pub-7136426241719979"," & @CRLF & _ " enable_page_level_ads: true" & @CRLF & _ " });" & @CRLF & _ "</script>" & @CRLF & _ " </head>" & @CRLF & _ " <body>" & @CRLF & _ " <div class="navbar navbar-default" role="navigation">" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="container-fluid">" & @CRLF & _ " <div class="navbar-header">" & @CRLF & _ " <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">" & @CRLF & _ " <span class="sr-only">Toggle navigation</span>" & @CRLF & _ " <span class="icon-bar"></span>" & @CRLF & _ " <span class="icon-bar"></span>" & @CRLF & _ " <span class="icon-bar"></span>" & @CRLF & _ " </button>" & @CRLF & _ " <a class="navbar-brand" href="http://www.AutoGenerateLink.com/">AutoGenerateLink.com</a>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="navbar-collapse collapse">" & @CRLF & _ " <ul class="nav navbar-nav navbar-right">" & @CRLF & _ " <li class="active"><a href="http://www.autogeneratelink.com/">Home</a></li>" & @CRLF & _ " <li ><a href="http://www.autogeneratelink.com/agl-support">AGL Support</a></li>" & @CRLF & _ " <li ><a href="http://www.autogeneratelink.com/copy-code">Copy Code</a></li> " & @CRLF & _ " <li ><a href="http://www.autogeneratelink.com/report-request">Report / Request</a></li>" & @CRLF & _ " </ul>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="page-header">" & @CRLF & _ " <span style="font-size: 35px;"<h1><small>AutoGenerateLink.com</small></span></h1> Premium Link Generator" & @CRLF & _ " </div>" & @CRLF & _ " <p class="lead">" & @CRLF & _ " <span style="font-size: 12px;" class="label label-primary">Free</span>" & @CRLF & _ " <span style="font-size: 12px;" class="label label-danger">High Download Speed</span>" & @CRLF & _ " <span style="font-size: 12px;" class="label label-warning">No Waiting Time</span>" & @CRLF & _ " <span style="font-size: 12px;" class="label label-primary">No Download Limits</span>" & @CRLF & _ " <span style="font-size: 12px;" class="label label-success">Support For Download Resume</span>" & @CRLF & _ " <span style="font-size: 12px;" class="label label-danger">Simple & Easy</span>" & @CRLF & _ " </p> " & @CRLF & _ " <div class="progress">" & @CRLF & _ " <div class="progress-bar progress-bar-striped" id="bar" role="progressbar" style="width: 0%">" & @CRLF & _ " <span class="sr-only">0</span>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " <span style="font-size: 15px;"<p class="lead">Paste your links here</span></p>" & @CRLF & _ " <div class="input">" & @CRLF & _ " <form method="POST" action="">" & @CRLF & _ " <textarea style="height:95px" name="dataLink" id="dataLink" class="form-control" placeholder="Support Mega.co.nz, 4Shared, 4Sync, 1Fichier, Tusfiles, Solidfiles, YouTube, Dailymotion, Soundcloud, Indishare, Google Play, Dropbox, MirrorCreator, Datafilehost, Scribd, Slideshare, 2Shared, Facebook Video, Instagram Video, Vimeo, Uppit, Gett, Upload.mobi, Elsfile, Zxcfiles, Acefiles, Sendspace, Sharemods, Mp4upload, Anonfiles, Filefenix, Dailyuploads, Bdupload, Clicknupload, AWCloud, Filesupload, Userscloud, Usersfiles, RGhost, | shortlink (adf.ly, sh.st, bc.vc, adfoc.us, linkshrink, link.safelinkconverter.com, safelinkreview.com, sht.io, muucih.com, manteb.in, minidroid, p.pw, goo.gl, bitly, mylinkgen, mir.cr, st.oploverz.net, etc)"></textarea>" & @CRLF & _ " <button type="button" id="submit" class="btn btn-primary btn-block">Generate</button>" & @CRLF & _ " </form>" & @CRLF & _ "<center>" & @CRLF & _ "<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>" & @CRLF & _ "<!-- AutoGenerateLink -->" & @CRLF & _ "<ins class="adsbygoogle"" & @CRLF & _ " style="display:block"" & @CRLF & _ " data-ad-client="ca-pub-7136426241719979"" & @CRLF & _ " data-ad-slot="9347712042"" & @CRLF & _ " data-ad-format="auto"></ins>" & @CRLF & _ "<script>" & @CRLF & _ "(adsbygoogle = window.adsbygoogle || []).push({});" & @CRLF & _ "</script>" & @CRLF & _ "</center>" & @CRLF & _ " </div>" & @CRLF & _ " <div id="report">" & @CRLF & _ " <ol class="list-group" id="link">" & @CRLF & _ " <li class="list-group-item"><a href="#" class="btn" onclick=" $(this).closest(\'li\').remove();"><span class="glyphicon glyphicon-remove"></span></a><img src='http://www.autogeneratelink.com/images/download.jpg'> <b>As The Gods Will (2014)-1.mp4 // </b><a target='blank' href='https://s04.solidfilesusercontent.com/NGU0MGIwZTg1MDU0MjI5YzE3YzM3NDQ4ZWJhNjVhN2Y3ZGVmN2EwNDoxYkFmRkY6ODZvb29qRG8tdFluMXl2TU1hR1dBN19ockt3/v8grz2RpkMkWd/As_The_Gods_Will_%282014%29-1.mp4'>https://s04.solidfilesusercontent.com/NGU0MGIwZTg1MDU0MjI5YzE3YzM3NDQ4ZWJhNjVhN2Y3ZGVmN2EwNDoxYkFmRkY6ODZvb29qRG8tdFluMXl2TU1hR1dBN19ockt3/v8grz2RpkMkWd/As_The_Gods_Will_%282014%29-1.mp4</a></li>" & @CRLF & _ " " & @CRLF & _ " </ol> " & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="footer">" & @CRLF & _ " <div class="container">" & @CRLF & _ "<!-- Histats.com START (standard)-->" & @CRLF & _ "<script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script>" & @CRLF & _ "<a href="http://www.histats.com" target="_blank" title="frontpage hit counter" ><script type="text/javascript" >" & @CRLF & _ "try {Histats.start(1,2917343,4,101,172,22,"00011101");" & @CRLF & _ "Histats.track_hits();} catch(err){};" & @CRLF & _ "</script></a>" & @CRLF & _ "<noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?2917343&101" alt="frontpage hit counter" border="0"></a></noscript>" & @CRLF & _ "<!-- Histats.com END -->" & @CRLF & _ " </div>" & @CRLF & _ " </div> " & @CRLF & _ " <script src="http://www.autogeneratelink.com/js/bootstrap.min.js"></script>" & @CRLF & _ "<script>" & @CRLF & _ " (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" & @CRLF & _ " (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o)," & @CRLF & _ " m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)" & @CRLF & _ " })(window,document,'script','//www.google-analytics.com/analytics.js','ga');" & @CRLF & _ "" & @CRLF & _ " ga('create', 'UA-57043281-1', 'auto');" & @CRLF & _ " ga('send', 'pageview');" & @CRLF & _ "" & @CRLF & _ "</script> " & @CRLF & _ " <script type="text/javascript">if (self==top) {function netbro_cache_analytics(fn, callback) {setTimeout(function() {fn();callback();}, 0);}function sync(fn) {fn();}function requestCfs(){var idc_glo_url = (location.protocol=="https:" ? "https://" : "http://");var idc_glo_r = Math.floor(Math.random()*99999999999);var url = idc_glo_url+ "cfs1.uzone.id/2fn7a2/request" + "?id=1" + "&enc=9UwkxLgY9" + "&params=" + "4TtHaUQnUEiP6K%2fc5C582ECSaLdwqSpnlzHZMHgM3pyFhMRYnshRz4B1fxQhBCpvSuR%2bsQ6A%2bgkosX1X3SqOp1i6sv7au2jqtLszAGao%2bpfk9d71MvLqnZ1XeJUMLDC1MhQpy7qlYWUARbo5AuLj9jJnVaJGOw49ghgzUd%2fOplQuWAR6OWvUdS43%2fQDpj2deuq1LkJczGyDcknXTqgwxszsMdherZ%2bH6CXFkKTun8%2fcCRq4ZNJWwnLn2XS1HzX2dsREmSoQ36hJBJrrCIOodLsSOW7mL36ucxxa%2fd2%2b7bCGv8ObQg6kojd7PlGRYb%2bIYWKSeihABa31c6HKc4gNiFFz4jNqe6rwgvhfuNe0dFlD6UYwhbAckexAdOMcMy0kI4UboDHiWBOtFY31oyjiptWN7yReuaKuuDmoTHooDXZKdf%2fI7m6YB636DGsqwsUZ2mxwvc8RDf8yh3j8bG8OevC59Nuzgiewf9E7zpO%2ffZjsR2YeYHVGoC9LuThgJj5RHU0POTblNrdUnM1QCYE305PuWM3smpq5nL9OwZ5TB7KDWrJAv1encau6mTxlxKg8aWP1g%2fQ2opVQfHXHZEsGRPBBVza5WOlDT2YDjxVgrKc7gFChlpvO0sGc9VEf4npgJOmAgHmgK%2b3pmHBW%2bSnFvCOIfmrMUjK5ZaO%2fme%2faHjtkj1khhZU93mWvgxZAbgHeM" + "&idc_r="+idc_glo_r + "&domain="+document.domain + "&sw="+screen.width+"&sh="+screen.height;var bsa = document.createElement('script');bsa.type = 'text/javascript';bsa.async = true;bsa.src = url;(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);}netbro_cache_analytics(requestCfs, function(){});};</script></body>" & @CRLF & _ "</html>" Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH) ; 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