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

/
/

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 = "(?s)(<pre>.+?<\/pre>)" Local $sString = " <!DOCTYPE HTML>" & @CRLF & _ "<html lang="en-US">" & @CRLF & _ "<head>" & @CRLF & _ "" & @CRLF & _ " <meta charset="UTF-8">" & @CRLF & _ " <title>'HPTjNRgUfG' | TextUploader.com</title>" & @CRLF & _ " <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">" & @CRLF & _ " <link rel="icon" type="image/ico" href="http://textuploader.com/favicon.ico">" & @CRLF & _ "" & @CRLF & _ " <meta property="og:title" content="HPTjNRgUfG" xmlns="http://www.w3.org/1999/html"/>" & @CRLF & _ " <meta property="og:type" content="article"/>" & @CRLF & _ " <meta property="og:url" content="http://textuploader.com/5jx4u"/>" & @CRLF & _ " <meta property="og:site_name" content="textuploader.com - HPTjNRgUfG"/>" & @CRLF & _ " <meta property="og:description" content="Please call back later &lt;a href=&quot; http://philadelphiaexplorers.org/about-the-explorers-club/#annual &quot;&gt;a..."/>" & @CRLF & _ " <link rel="canonical" href="http://textuploader.com/5jx4u"/>" & @CRLF & _ " <!-- bootstrap framework css -->" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap.min.css">" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css">" & @CRLF & _ " <!-- power tooltips -->" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip.css">" & @CRLF & _ "" & @CRLF & _ " <!-- main stylesheet -->" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/beoro.css">" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/tu_custom.css">" & @CRLF & _ "" & @CRLF & _ " <!--[if lte IE 8]><link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/ie8.css">" & @CRLF & _ "<![endif]-->" & @CRLF & _ " <!--[if IE 9]><link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/ie9.css">" & @CRLF & _ "<![endif]-->" & @CRLF & _ "" & @CRLF & _ " <!--[if lt IE 9]>" & @CRLF & _ " <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2pre/html5shiv.js"></script>" & @CRLF & _ " <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>" & @CRLF & _ " <script src="//cdnjs.cloudflare.com/ajax/libs/flot/0.7/excanvas.min.js"></script>" & @CRLF & _ " <![endif]-->" & @CRLF & _ "" & @CRLF & _ " <script type="text/javascript">" & @CRLF & _ " var _gaq = _gaq || [];" & @CRLF & _ " _gaq.push(['_setAccount', 'UA-36314765-1']);" & @CRLF & _ " _gaq.push(['_setDomainName', 'textuploader.com']);" & @CRLF & _ " _gaq.push(['_setAllowLinker', true]);" & @CRLF & _ " _gaq.push(['_trackPageview']);" & @CRLF & _ " (function() {" & @CRLF & _ " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;" & @CRLF & _ " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';" & @CRLF & _ " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);" & @CRLF & _ " })();" & @CRLF & _ " </script>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " <link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/styles/default.min.css">" & @CRLF & _ " <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/highlight.min.js"></script>" & @CRLF & _ " <script>hljs.initHighlightingOnLoad();</script>" & @CRLF & _ "" & @CRLF & _ "</head>" & @CRLF & _ "" & @CRLF & _ "<body class="bg_c">" & @CRLF & _ "" & @CRLF & _ "<div id="fb-root"></div>" & @CRLF & _ "<script>(function (d, s, id) {" & @CRLF & _ " var js, fjs = d.getElementsByTagName(s)[0];" & @CRLF & _ " if (d.getElementById(id)) return;" & @CRLF & _ " js = d.createElement(s);" & @CRLF & _ " js.id = id;" & @CRLF & _ " js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=456470037742170";" & @CRLF & _ " fjs.parentNode.insertBefore(js, fjs);" & @CRLF & _ " }(document, 'script', 'facebook-jssdk'));</script>" & @CRLF & _ "<!-- main wrapper (without footer) -->" & @CRLF & _ "<div class="main-wrapper">" & @CRLF & _ " <!-- top bar -->" & @CRLF & _ "" & @CRLF & _ " <div class="navbar navbar-fixed-top">" & @CRLF & _ " <div class="navbar-inner">" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="pull-right top-search">" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " <div id="fade-menu" class="pull-left">" & @CRLF & _ " <ul class="clearfix" id="mobile-nav">" & @CRLF & _ " <li><a href="http://textuploader.com/">Home</a></li>" & @CRLF & _ " <li><a href="http://textuploader.com/discover">Discover</a></li>" & @CRLF & _ " <li><a href="http://textuploader.com/help">Help</a></li>" & @CRLF & _ " <li><a href="http://textuploader.com/developers">Developers</a></li>" & @CRLF & _ " <li><a href="http://textuploader.com/contact">Contact</a></li>" & @CRLF & _ "" & @CRLF & _ " <li><a href='https://textuploader.com/profile'>My Account</a>" & @CRLF & _ " </li>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " </ul>" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ " <!-- header -->" & @CRLF & _ " <header>" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="row">" & @CRLF & _ " <div class="span3">" & @CRLF & _ " <!-- <div class="main-logo"><a href="http://textuploader.com/"><img src="http://textuploader.com/assets/img/textuploader_logo.png" alt="TextUploader.com"></div> -->" & @CRLF & _ " <div class="main-logo"><a href='http://textuploader.com/'><img src="http://textuploader.com/assets/img/textuploader_logo.png" alt="TextUploader.com"></a></div>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="span5">" & @CRLF & _ " <nav class="nav-icons">" & @CRLF & _ " <!-- small icons navigation -->" & @CRLF & _ " </nav>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="span4">" & @CRLF & _ " <div class="user-box">" & @CRLF & _ " <div class="user-box-inner">" & @CRLF & _ " <img src="//www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=80&r=g&d=mm" class="user-avatar img-avatar" alt="Gravatar"/>" & @CRLF & _ "" & @CRLF & _ " <div class="user-info">" & @CRLF & _ " <a href="https://textuploader.com/register">Create an Account</a> <ul class="unstyled">" & @CRLF & _ " <li><a href="https://textuploader.com/auth/login">Login</a></li>" & @CRLF & _ " <li>&middot;</li>" & @CRLF & _ " <li><a href="https://textuploader.com/auth/password/forgot">Password</a></li>" & @CRLF & _ " </ul>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </header>" & @CRLF & _ "" & @CRLF & _ " <!-- breadcrumbs -->" & @CRLF & _ " <div class="container">" & @CRLF & _ " <ul id="breadcrumbs">" & @CRLF & _ " <li>" & @CRLF & _ " <a href="http://textuploader.com/">" & @CRLF & _ " <i class="icon-home"></i>" & @CRLF & _ " </a></li>" & @CRLF & _ "" & @CRLF & _ " <li><a href="http://textuploader.com/">Home</a></li>" & @CRLF & _ " <li><a href="http://textuploader.com/5jx4u">textuploader.com/5jx4u</a></li>" & @CRLF & _ "" & @CRLF & _ " <li><span>Posted on: 11/16/15 1:59:00 AM UTC</span></li>" & @CRLF & _ " </ul>" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " <!-- main content -->" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="row-fluid">" & @CRLF & _ " <div class="span12">" & @CRLF & _ " <div class="w-box w-box-blue">" & @CRLF & _ " <div class="w-box-header"><h4>"HPTjNRgUfG" - Views: 2 &middot; Hits: 2 - Type: Public</h4></div>" & @CRLF & _ " <div class="w-box-content cnt_a ">" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ "<div class="toolbar clearfix">" & @CRLF & _ " <div class="pull-left">" & @CRLF & _ " <div class="toolbar-icons clearfix">" & @CRLF & _ " <div style="overflow:hidden;width:90px;float:left;">" & @CRLF & _ " <div class="fb-like" data-href="http://textuploader.com/5jx4u" data-send="false" data-layout="button_count"" & @CRLF & _ " data-width="450" data-show-faces="false"></div>" & @CRLF & _ "</div>" & @CRLF & _ "<div style="overflow:hidden;width:90px;float:left;">" & @CRLF & _ " <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://textuploader.com/5jx4u">Tweet</a>" & @CRLF & _ "</div>" & @CRLF & _ "<div style="overflow:hidden;width:90px;float:left;">" & @CRLF & _ " <div class="g-plusone" data-size="medium" data-annotation="none"" & @CRLF & _ " data-href="http://textuploader.com/5jx4u"></div>" & @CRLF & _ "</div>" & @CRLF & _ "<div style="clear:both"></div>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="pull-right">" & @CRLF & _ " <div class="btn-group">" & @CRLF & _ " <button class="btn btn-mini" onClick="parent.location='http://textuploader.com/5jx4u/rev'; void(0);">Revisions (0)</button>" & @CRLF & _ " <button class="btn btn-mini" onClick="parent.location='http://textuploader.com/contact'; void(0);">Report Abuse</button>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ "</div>" & @CRLF & _ "<pre><code class='no-highlight'>Please call back later &lt;a href=&quot; http://philadelphiaexplorers.org/about-the-explorers-club/#annual &quot;&gt;accidently took 2 40 mg paxil&lt;/a&gt; &quot;We need that flexibility,&quot; Fox said. &quot;When you pick your offensive line, not just for the season, but for game day, you have to pick them from the standpoint of having some flexibility. You&#039;ve got to have a swing guard/center, you&#039;ve got to have a swing tackle/guard, for the games.&quot;" & @CRLF & _ " </code></pre>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ "" & @CRLF & _ " </div>" & @CRLF & _ "" & @CRLF & _ " <div class="footer_space"></div>" & @CRLF & _ "</div>" & @CRLF & _ "<!-- footer -->" & @CRLF & _ "<footer>" & @CRLF & _ " <div class="container">" & @CRLF & _ " <div class="row">" & @CRLF & _ " <div class="span8">" & @CRLF & _ " <div>&copy; 2016 <a href="http://www.exsom.com" target="_blank">Exsom Group, LLC</a>. All Rights Reserved.</div>" & @CRLF & _ " </div>" & @CRLF & _ " <div class="span4">" & @CRLF & _ " <ul class="unstyled">" & @CRLF & _ "<!-- " & @CRLF & _ "<li><a href="https://tuarmor.com">TUArmor</a></li>" & @CRLF & _ " <li>&middot;</li>" & @CRLF & _ "-->" & @CRLF & _ " <li><a href="http://textuploader.com/terms-of-service">Terms of Service</a></li>" & @CRLF & _ " <li>&middot;</li>" & @CRLF & _ " <li><a href="http://textuploader.com/privacy">Privacy Policy</a></li>" & @CRLF & _ " <li>&middot;</li>" & @CRLF & _ " <li><a href="http://textuploader.com/dmca">DMCA</a></li>" & @CRLF & _ " <li>&middot;</li>" & @CRLF & _ " <li><a href="http://status.textuploader.com/">System Status</a></li>" & @CRLF & _ " </ul>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ " </div>" & @CRLF & _ "</footer>" & @CRLF & _ "<!-- Common JS -->" & @CRLF & _ "<!-- jQuery framework -->" & @CRLF & _ "<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>" & @CRLF & _ "<!-- bootstrap Framework plugins -->" & @CRLF & _ "<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0//js/bootstrap.min.js"></script>" & @CRLF & _ "<!-- top menu -->" & @CRLF & _ "<script src="http://textuploader.com/assets/js/jquery.fademenu.js"></script>" & @CRLF & _ "<!-- top mobile menu -->" & @CRLF & _ "<script src="http://textuploader.com/assets/js/selectnav.min.js"></script>" & @CRLF & _ "<!-- actual width/height of hidden DOM elements -->" & @CRLF & _ "<script src="http://textuploader.com/assets/js/jquery.actual.min.js"></script>" & @CRLF & _ "<!-- jquery easing animations -->" & @CRLF & _ "<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>" & @CRLF & _ "<!-- power tooltips -->" & @CRLF & _ "<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip-1.1.0.min.js"></script>" & @CRLF & _ "<!-- date library -->" & @CRLF & _ "<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/1.7.2/moment.min.js"></script>" & @CRLF & _ "<!-- common functions -->" & @CRLF & _ "<script src="http://textuploader.com/assets/js/beoro_common.js"></script>" & @CRLF & _ "" & @CRLF & _ "<!-- twitter button code -->" & @CRLF & _ "<script>!function (d, s, id) {" & @CRLF & _ " var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';" & @CRLF & _ " if (!d.getElementById(id)) {" & @CRLF & _ " js = d.createElement(s);" & @CRLF & _ " js.id = id;" & @CRLF & _ " js.src = p + '://platform.twitter.com/widgets.js';" & @CRLF & _ " fjs.parentNode.insertBefore(js, fjs);" & @CRLF & _ " }" & @CRLF & _ " }(document, 'script', 'twitter-wjs');</script>" & @CRLF & _ "" & @CRLF & _ "<!-- +1 code -->" & @CRLF & _ "<script type="text/javascript">" & @CRLF & _ " (function () {" & @CRLF & _ " var po = document.createElement('script');" & @CRLF & _ " po.type = 'text/javascript';" & @CRLF & _ " po.async = true;" & @CRLF & _ " po.src = '//apis.google.com/js/plusone.js';" & @CRLF & _ " var s = document.getElementsByTagName('script')[0];" & @CRLF & _ " s.parentNode.insertBefore(po, s);" & @CRLF & _ " })();" & @CRLF & _ "</script>" & @CRLF & _ "</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