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

/
/
gm

Test String

Code Generator

Generated Code

$re = '/(?!.*FitGirl.*)(?i)(?<=\s|^|\W)(.*update.*|.*dlc.*|.*expansion.*|.*artwork.*|.*fix.*|.*keygen.*|.*goodies.*|.*guide.*|.*trainer.*)(?=\s|$|\W)\s*$/m'; $str = '2015 - Original Edition [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Blood.and.Wine-CODEX [English, Scene, Full ISO] 5 years ago 40.18 GB 453 35 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Blood.and.Wine.MULTi15-PROPHET [Multi-Language, Scene, Full ISO] 5 years ago 65.75 GB 472 47 0 2015 - GOG Edition [ DL | FL | RP | PL ] » The Witсhеr З: Wild Нunt (v1.21 + 16 DLC + HoS + B&W) FitGirl [Multi-Language, DRM Free] 5 years ago 47.14 GB 771 63 1 2016 - Game of the Year Edition [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Game.of.The.Year.Edition-RELOADED [English, Scene, Full ISO] 4 years ago 40.56 GB 552 50 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Game.of.The.Year.Edition.MULTi16-PROPHET [Multi-Language, Scene, Full ISO] 4 years ago 66.45 GB 513 49 0 2016 - GOG Game of the Year Edition [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt GOTY (v1.31/v1.32+All DLCs) [FitGirl Repack] [Multi-Language, P2P] 2 years ago 43.51 GB 1,556 450 17 [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt - Game of the Year Edition v1.31a (9709) [Multi-Language, DRM Free] 6 months ago 33.50 GB 131 73 0 GameDOX - Artwork [ DL | FL | RP | PL ] » The Witcher 3 Wild Hunter + Hearts of Stone + Blood and Wine Bonus Content - Artwork [Multi-Language, Digital, GameDOX] 4 years ago 3.58 GB 252 60 0 GameDOX - Downloadable Content [ LN | RP | PL ] » The Witcher 3: Wild Hunt - Free DLC Prog [GameDOX - External Link] 26 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.3-BAT [Multi-Language, Scene, GameDOX] 6 years ago 86.68 MB 292 40 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.4-BAT [Multi-Language, Scene, GameDOX] 5 years ago 74.02 MB 282 38 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.5-BAT [Multi-Language, Scene, GameDOX] 5 years ago 151.69 MB 259 35 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack-BAT [Multi-Language, Scene, GameDOX] 5 years ago 97.29 MB 224 36 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.2-BAT [Multi-Language, Scene, GameDOX] 5 years ago 45.02 MB 230 34 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.6-BAT [Multi-Language, Scene, GameDOX] 5 years ago 146.88 MB 216 35 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.DLC.Pack.7-BAT [Multi-Language, Scene, GameDOX] 5 years ago 13.04 MB 275 37 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Hearts.of.Stone.Expansion-GOG - DLC [Multi-Language, GameDOX] 5 years ago 4.25 GB 468 37 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Blood.and.Wine.Expansion-GOG - DLC [Multi-Language, GameDOX] 5 years ago 7.09 GB 498 38 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Hearts.of.Stone.Expansion.Steam-3DM - DLC [Multi-Language, GameDOX] 5 years ago 2.12 GB 208 20 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Blood.and.Wine.Expansion.v1.21.Steam-3DM - DLC [Multi-Language, GameDOX] 4 years ago 8.11 GB 240 20 0 GameDOX - Fixes and Keygens [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Language.Pack.French-GOG - Fix/Keygen [French, GameDOX] 6 years ago 2.49 GB 165 25 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Language.Pack.German-GOG - Fix/Keygen [German, GameDOX] 6 years ago 2.61 GB 160 21 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Language.Pack.Polish-GOG - Fix/Keygen [Polish, GameDOX] 6 years ago 2.42 GB 163 21 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Language.Pack.Russian-GOG - Fix/Keygen [Russian, GameDOX] 6 years ago 2.56 GB 155 23 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Language.Pack.Portuguese-Brazilian-GOG - Fix/Keygen [Portuguese, GameDOX] 6 years ago 2.49 GB 158 20 0 GameDOX - GOG Goodies [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt - GOG-Goodies [Multi-Language, GameDOX] 6 months ago 9.79 GB 27 11 0 [ DL | FL | RP | PL | OG ] » The Witcher Goodies Collection - GOG-Goodies [Multi-Language, GameDOX - Internal Link] 3 weeks ago 45.97 GB 32 13 0 GameDOX - Game Guides [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt - Prima Official Game Guide [English, PDF, Scan (300 DPI), GameDOX] 2 years ago 822.16 MB 219 66 0 GameDOX - Trainers [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.0-v1.32.Plus.22.Trainer-FLiNG [Multi-Language, GameDOX] 1 month ago 989.12 KB 19 10 0 GameDOX - Updates [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt v1.31(a) to v1.32 - Update [Multi-Language, GameDOX] 2 years ago 332.79 MB 158 36 0 [ DL | FL | RP | PL ] » The Witcher 3: Wild Hunt GOTY Update v1.31 (2.0.0.52) GOG [Multi-Language, GameDOX] 4 years ago 274.16 MB 386 47 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Patch.1.30-GOG - Update [Multi-Language, GameDOX] 4 years ago 1.02 GB 350 38 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.24.Update-GOG [Multi-Language, GameDOX] 4 years ago 11.54 MB 431 48 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.Blood.and.Wine.Update.v1.22-CODEX [English, Scene, GameDOX] 4 years ago 1.22 GB 232 23 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.22.Update-GOG [Multi-Language, GameDOX] 4 years ago 2.71 GB 412 34 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.21.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.06 GB 211 25 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.12.1.Update-GOG [Multi-Language, GameDOX] 5 years ago 477.79 MB 328 34 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.11.Update-GOG [Multi-Language, GameDOX] 5 years ago 454.69 MB 393 32 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.10.Update-GOG [Multi-Language, GameDOX] 5 years ago 9.97 GB 528 33 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.08.4.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.05 GB 242 27 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.08.3.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.04 GB 307 30 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.08.2.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.04 GB 293 26 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.08.1.Update-GOG [Multi-Language, GameDOX] 5 years ago 3.79 GB 264 27 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.08.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.05 GB 303 29 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.07.Update-GOG [Multi-Language, GameDOX] 5 years ago 2.04 GB 348 28 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.06.Update-GOG [Multi-Language, GameDOX] 6 years ago 287.67 MB 503 35 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.05.Update-GOG [Multi-Language, GameDOX] 6 years ago 282.60 MB 618 41 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.04.Update-GOG [Multi-Language, GameDOX] 6 years ago 273.99 MB 809 45 0 [ DL | FL | RP | PL ] » The.Witcher.3.Wild.Hunt.v1.03.Update-GOG [Multi-Language, GameDOX] 6 years ago 271.69 MB 428 41 0'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);

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 PHP, please visit: http://php.net/manual/en/ref.pcre.php