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

/
/
gixXsuUAJDm

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 = "(?ixXsuUAJDm)Safari infiltrator.v.1.2.2" Local $sString = "Safari with Infiltrator.v.1.2.2" & @CRLF & _ "by superkiller~<.\$~superkiller$.temp~>" & @CRLF & _ "var result = [get,.url,.get,.add,.url,.get,.url:.aa\?.\$~superkiller$.temp~\:\:C:\Users\$~superkiller$.temp~\Safari = [get,add,url, var = get, add, url, get, url, add url]}{|}{:~<.n#0123456789998876521353124542125666666.nh:{[(<h:.aa\?.? var = <963>:.aa\?.>]}{|}{:get,add,url>]}: if get; var = url; if add, get, var = get(url);" & @CRLF & _ "{[(<9653778993:#Safari.("<(-_-)>~,.!.,[infiltrator.v1.2.2 by superkiller];}])>~#22FF85#" & @CRLF & _ "// Hent alle links fra siden" & @CRLF & _ "var elements = document.querySelectorAll("a");" & @CRLF & _ "for (let element of elements) {" & @CRLF & _ " result.push({" & @CRLF & _ " "url": element.href," & @CRLF & _ " "text": element.innerText" & @CRLF & _ "var result = ["%.-2*%#!%*-.x=-~(x.=.-100.25:159.75:300.75:385.11:534.43:902.25:1540.44:2706.75.-~=C:\Users\$~superkiller$\desktop\$~superkiller$.temp~.txt)"];let if :45:1.id_TOKEN_WDGF.accept.45:55.C:\Users\$~superkiller$.temp~\id_token.txt" if var "results"; in "var 45:55.WDGF.id.TOKEN.txt";" & @CRLF & _ "if "result"; "denied";'try' if do; "allow"; if "results" = "ping";"ACCESS_TOKEN:re:token;by it as to re 'old' by bind::(.2).new,.:45.! 'old' to use "45":45.:(:re:):.aa\." & @CRLF & _ "WDGF\/.@!@SNA@!@.\/:"1":024542568999865245420:.aa\999/aa.:024542568999865245420:" & @CRLF & _ "var results = "55"; do, if, var "45.55":*:"if: = "id_TOKEN. do" :55:45.55:222222.-:*:-.2/}{|}{:(.2>:("id.45:55:43.?...:34.42.55:45:55") if = "$~superkiller$.temp~"; var if "show" = "$~superkiller$.temp~" if "access" = "only show" = "$~superkiller$.temp~" if "_id_:(:re:):$~superkiller$.temp~";" & @CRLF & _ "var return "$~superkiller$.temp~"" & @CRLF & _ "if return "$~superkiller$.temp~"" & @CRLF & _ "return "$~superkiller$.temp~"" & @CRLF & _ "var "stay" if "stay" do "stay":(:re:):" & @CRLF & _ "// Safari Infiltrator.v.1.2.2 by superkiller" & @CRLF & _ "var get:.\aa?.:a:a:o:a#a:o:a:a var = "id_token":45 for WDGF_token.id.WDGF: if "45"; re :token_access = "previous" on "connnect" re-use "id_token" var "TOKEN_ACCESS" if "id" is "allow" do "use" or if var return "id_token" for "accept" or if as id_token = "allow" (test and work in progress); to use previous connected to hop token var = (token);if?:(token);var = "new"(var = id.token);if:("lost");var = "new"(get);var token(WDGF.n#9);var .n#6(get,add,token);var get,token,var add,token(".n#678999887666666");var .n#->~>=>[lost?(token);get,token(var = token);var add,token();var token();var used?:.aa\?.url();if token();var token();get token(); if token();var fetch(if do use new but ut can is if go on re is old by switch to this new?(););" & @CRLF & _ " });" & @CRLF & _ "}" & @CRLF & _ "" & @CRLF & _ "// Kald completion for at slutte" & @CRLF & _ "completion(result);" 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