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

/
/
gmi

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 = "(?mi)http:\/\/seluws1215\/PM2\/flex\/ProcessManager(?:Flex)?\.(?:php|html)\?#?(?:v=\d*&)?\w*=(\d*)" Local $sString = "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=12932" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=13179" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15032" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15121" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16452" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=13018" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15568" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15568" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=7056 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16283" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16283" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16929" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15587" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16394" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18585" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=17532" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18292" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18848" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=20177" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20551 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20423 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18613 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20870 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17747 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=12930 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21032 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20551 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17531 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21283 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=16929 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20804 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24585 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=23807 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21795 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24569 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24879 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24884 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24884 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20898 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24884 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24884 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25769 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24410 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24734 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25812 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21143 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24395 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25890 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25890 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25890 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25890 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25890 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=14869 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20777 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25819 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25819 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21735 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26842 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26842 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27084 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=23271 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27067 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25954 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18409 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21659 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18585 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21208 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28335 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24395 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24863 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27054 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26842 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26842 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18585 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28340 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28948 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29035 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28927 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26352 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26361 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29021 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29189 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29189 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29719 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29626 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=296229 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29743 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27244 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29953 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21771 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28340 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21710 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27138 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27624 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28238 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=23275 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24410 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30508 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30508 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18848 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30234 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30223 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30239 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30242 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30260 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24213 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24214 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27027 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=7056 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27069 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24410 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24410 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30622 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28658 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=25954 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=18543 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=12829 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24762 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26657 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29163 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31123 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20551 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31149 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31162 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29882 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=7057 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17329 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29961 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17049 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17329 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31243 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31243 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30292 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27624 " & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20895" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20895" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=16385" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=14984" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31841" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=21735" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31840" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31847" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31864" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=14384" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=23271" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=24534" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27145" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32265" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20728" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=6858" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28942" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26466" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28942" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28942" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30292" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=23298" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32307" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=12930" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=30543" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?#page=16384" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?#page=17104" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?#page=16384" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32306" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=28948" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=16384" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32166" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26266" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=17016" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=7093" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=29866" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20551" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20728" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=20856" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=26228" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32265" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=27145" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=13237" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32711" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=32306" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=31342" & @CRLF & _ "http://seluws1215/pm2/flex/ProcessManager.php?start=33648" 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