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
No Match

r"
"
g

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 = "x^" Local $sString = "unavailable speedometer's garbling Zambia subcontracted fullbacks Belmont mantra's" & @CRLF & _ "pizzicatos carotids bitch Hernandez renovate leopard Knuth coarsen" & @CRLF & _ "Ramada flu occupies drippings peaces siroccos Bartók upside twiggier configurable perpetuates tapering pint paralyzed" & @CRLF & _ "vibraphone stoppered weirdest dispute clergy's getup perusal fork" & @CRLF & _ "nighties resurgence chafe" & @CRLF & _ "slop's overdosed clewing lidded superstition regale swisher jaundiced multiplexors Indiana's Marquis fisher's" & @CRLF & _ "weekend's millimeter Khalid's knowingly" & @CRLF & _ "Clyde diuretic raggedness's Socratic initialization pluralized swilling louver's Caedmon's outreach's return regression shortened azures ultra's point bumping" & @CRLF & _ "sidesaddle's waxen Brussels wrested currant's scented Ariadne whammy hypertext's patrimony's Sicilians why indivisibility eluded scrounged impaneled grimaced friction's" & @CRLF & _ "infringing Sardinia's Dyer Seder's" & @CRLF & _ "amaze's" & @CRLF & _ "beeping potters cauldron's carnival's parricides sellouts roomiest Buick's bingeing gently procure Darin's inheritor Doonesbury's baldest tomfoolery's democratizes donates wage's" & @CRLF & _ "pencil obscure Opel's cymbal's loggerhead's cubed inessential's enrapturing gypsy" & @CRLF & _ "Velveeta capitalists garnets Waikiki shticks stoat's shred's anneals columned river's continuum preferring beloveds Junes Flintstones" & @CRLF & _ "" & @CRLF & _ "Buick's epaulette's legalized impecuniousness Apollonian esoterically attack fry's Hal some sweltered enduing astrological Sandy marble's chameleon reapportionment's" & @CRLF & _ "jeopardize Vaughn's antibodies carefully manifestation speakeasy's bookseller's" & @CRLF & _ "Freetown purplest japans Ruth audit Carr deceit schticks subservience kidnapper agrarians committal cashmere's Lanny's despondency stigmatizes Guiyang" & @CRLF & _ "mudslides grayness's Scotsmen recordings imparts windmilling cordite's worthlessness's tone" & @CRLF & _ "object uncommonest truism barbecued psychobabble's Lyndon's uncritical longevity shamefulness's overborne ulceration's" & @CRLF & _ "crud underweight's paginated phalli demonstratives indices deconstruction upright beetles stalemated Mediterranean surtax's sameness's pinafore piety purism truncation" & @CRLF & _ "satire jog Ward sullenness's counterclockwise portcullis's polyphony's aeration's injustices" & @CRLF & _ "geode's pouch's" & @CRLF & _ "charbroils crinoline advantaging nautilus's tangibility's progressing Evian copper sicken sublimates hoards" & @CRLF & _ "linseed's pheromone's approves clamor Henderson's tinkles demerit agonized Alec defrosting hotel" & @CRLF & _ "surveyors rib's African ghostwriting overrule sequoias Morales's whacks gantry alienable peddled" & @CRLF & _ "boardinghouses touts Slackware vindications rose's" & @CRLF & _ "morals acquaintances overreact cerebella Eu's blessedness's master palimony's perming mammalian's homophobic beefing fours sermonizes" & @CRLF & _ "Japura propagandists dulness momentous beer's cadaver's Kochab yawning Francoise's" & @CRLF & _ "dose's spike's plasterboard rendezvouses bitched nun's doodle hospitalize unwieldiness's torturer" & @CRLF & _ "abettor's predominantly tracker coagulation's shingle demoted lousiness" & @CRLF & _ "Trina poinsettias Wichita bellhops ammo's divinity's necking overcoming" & @CRLF & _ "physics backhoes rotary skylarks establishments adversity flood's" & @CRLF & _ "Bowery's tussled hoppers arachnid's Wilfred Gatling cranium ids salmonella" & @CRLF & _ "abdomens codeine's Urumqi mythology Macedonia's Kenmore's" & @CRLF & _ "trounces curses Comte faulting prefixes newel smugglers bawl's methodologies Max" & @CRLF & _ "tobogganing Olenek's adjudge loth" & @CRLF & _ "floaters update silence jiggers revolutionist sepulcher Formica's searchingly Cartesian Maya's halved hydrolysis McCullough's Zsigmondy badmouthed danced revolutionary slum's lanyards" & @CRLF & _ "repercussion's wrongfulness's earth's neonate Carmelo's" & @CRLF & _ "struggled heliports weathercock's appeasing pinched relegation weaned nappy" & @CRLF & _ "manganese deciduous ganged Mahayanist herbs individualizing repartee Albert aerators evolution monicker's electrifies Conner drooling Margret kibitzer excitation's Merriam's" & @CRLF & _ "misfortune ell determinations forever's trumpeting dreadfully voyeur's Markov noiselessly catechise cleaners muffler's gentleness's condense scholarship's Sang" & @CRLF & _ "Jeeves's Chappaquiddick's deodorants Tonia fixture preparations newsletter Nicola Stanton algorithms" & @CRLF & _ "honchos outspreading Kutuzov divulged" & @CRLF & _ "partition zinging Burnett cadge scrape's Poiret sulfured simplicity's inpatient's cottonwood sublease sublimate staled" & @CRLF & _ "mimicking disbarred shopping forgets jurist adulate bakery's pinkish atlases hatched encouraging flatware's talkers instrumentation negotiate refresher" & @CRLF & _ "Novosibirsk oblivious payment's widens" & @CRLF & _ "impoverishment's beehive's domination's etymologists virology Macon" & @CRLF & _ "humbugs inlaying truncheons downstream aesthetically substructure's fumigate Nannie afflicted Jr mimics pipsqueaks eBay's solid ague's" & @CRLF & _ "company herdsman misstates authorship pugnacity unlock flavor's Sn's longhand's trespass underscore Andean" & @CRLF & _ "" 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