Regular Expressions 101

Save & Share

  • Regex Version: ver. 2
  • 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

#include <StringConstants.au3> ; to declare the Constants of StringRegExp #include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate Local $sRegex = "(?m)(.*\n.*)\n(.*)\s{2,}(\d{5})\s{2,}\b(.*)" Local $sString = "" & @CRLF & _ "IUT Lyon 1 - Site de Bourg-en-Bresse" & @CRLF & _ "Rue Henri de Boissieu 01000 BOURG-EN-BRESSE" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 74 45 52 65 Fax : 04 74 45 52 01" & @CRLF & _ "Portable :" & @CRLF & _ "Contact : Claude Noel (chef de département de Génie Biologique de l’IUT Lyon 1)" & @CRLF & _ "E-mail : iutbourg.bio@univ-lyon1.fr" & @CRLF & _ "Site web : iut.univ-lyon1.fr" & @CRLF & _ "Historique" & @CRLF & _ "Création : septembre 2008" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "104 Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr)La bière en France Edition 2020" & @CRLF & _ "" & @CRLF & _ "du Bugey" & @CRLF & _ "Lacoux 01110 HAUTEVILLE-LOMPNES" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 67 36 43 36" & @CRLF & _ "Contact : Ludwig de Belvalet" & @CRLF & _ "E-mail : ludwig.debelvalet@gmail.com" & @CRLF & _ "Site web : la-biere-du-plateau.webnode.fr" & @CRLF & _ "www.facebook.com/brasseriedubugey" & @CRLF & _ "Historique" & @CRLF & _ "Création : mars 2017" & @CRLF & _ "La gamme de bières était brassée entre juin 2009 et décembre 2014 par La Bière du Plateau (Hauteville-Lompnes, FR), puis par La " & @CRLF & _ "Jacquerie (Conzieu, FR) entre décembre 2014 et mars 2017" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2017 : 60 hl" & @CRLF & _ "2018 : 72 hl" & @CRLF & _ "2019 : 80 hl (1)" & @CRLF & _ "" & @CRLF & _ "L'Etincelle" & @CRLF & _ "131, rue Les Cornes à Collet - Les Granges 01130 LE POIZAT-LALLEYRIAT" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 74 77 01 07 Fax : " & @CRLF & _ "Portable : 06 38 35 94 02" & @CRLF & _ "Contact : Erwan Bernard" & @CRLF & _ "E-mail : erwan.bernard@brasserie-letincelle.fr" & @CRLF & _ "Site web : www.brasserie-letincelle.fr" & @CRLF & _ "www.facebook.com/Brasserieletincelle" & @CRLF & _ "Historique" & @CRLF & _ "Création : juin 2018" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 50 hl" & @CRLF & _ "2019 : 150 hl (1)" & @CRLF & _ "" & @CRLF & _ "Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr) 105Edition 2020 La bière en France" & @CRLF & _ "" & @CRLF & _ "3B" & @CRLF & _ "Brasserie Bassin Bellegardien" & @CRLF & _ "2t, route du Chêne 01200 BILLIAT" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 82 84 60 11" & @CRLF & _ "Contact : Johan Primaut" & @CRLF & _ "E-mail : 3b.brasserie@gmail.com" & @CRLF & _ "Site web : www.facebook.com/brasserie3b" & @CRLF & _ "Historique" & @CRLF & _ "Création : novembre 2017" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "Bière Yourself" & @CRLF & _ "11, rue de Versoix 01210 FERNEY-VOLTAIRE" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 07 61 99 84 15" & @CRLF & _ "Contact : Maxime Collet (gérant)" & @CRLF & _ "E-mail : info@biereyourself.fr" & @CRLF & _ "mfmcollet@gmail.com" & @CRLF & _ "Site web : www.biereyourself.fr" & @CRLF & _ "www.facebook.com/BiereYourself" & @CRLF & _ "Historique" & @CRLF & _ "Création : octobre 2018" & @CRLF & _ "Principalement ateliers de brassage de bières mais également production en petite quantité de bières artisanales (brassins de 20l)" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2019 : 20 hl (1)" & @CRLF & _ "" & @CRLF & _ "106 Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr)La bière en France Edition 2020" & @CRLF & _ "" & @CRLF & _ "Gessienne" & @CRLF & _ "SARL STAJAM" & @CRLF & _ "308, rue de Perruet - ZA de la Maladière 01210 ORNEX" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 50 40 59 89 Fax : " & @CRLF & _ "Portable : 06 84 67 55 13" & @CRLF & _ "Contact : Stéphanie Ponsart" & @CRLF & _ "E-mail : contact@brasseriegessienne.fr" & @CRLF & _ "Site web : www.brasseriegessienne.fr" & @CRLF & _ "www.facebook.com/brasserie.gessienne" & @CRLF & _ "Historique" & @CRLF & _ "Création : juin 2012" & @CRLF & _ "Changement de nom et de statut en avril 2012 : SARL STAJAM" & @CRLF & _ "Ancienne adresse avant mars 2016 : 358 rue de Perruet - ZA de la Maladière 01210 ORNEX" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 430 hl" & @CRLF & _ "2019 : 480 hl (1)" & @CRLF & _ "" & @CRLF & _ "de Grilly" & @CRLF & _ "840, route de Divonne 01220 GRILLY" & @CRLF & _ "" & @CRLF & _ "Tél. : 09 63 51 63 93 Fax : " & @CRLF & _ "Portable : 06 06 45 93 49 (Frédéric)" & @CRLF & _ "Contact : Koos de Korte, Clément Piazza, Frédéric Manson" & @CRLF & _ "E-mail : info@brasserie-artisanale-de-grilly.fr" & @CRLF & _ "mansfred@hotmail.com" & @CRLF & _ "Site web : www.brasserie-artisanale-de-grilly.fr" & @CRLF & _ "www.facebook.com/brasserieartisanaledegrilly" & @CRLF & _ "Historique" & @CRLF & _ "Création : novembre 2017" & @CRLF & _ "La brasserie dispose d'un bar L'Echappée Belle situé à la même adresse" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 350 hl (1)" & @CRLF & _ "2019 : 600 hl (1)" & @CRLF & _ "" & @CRLF & _ "Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr) 107Edition 2020 La bière en France" & @CRLF & _ "" & @CRLF & _ "Saint Clair" & @CRLF & _ "893, route de Pont d'Ain 01250 MONTAGNAT" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 07 50 60 43 08" & @CRLF & _ "Contact : Jean-Pierre Bertrand (Président)" & @CRLF & _ "E-mail : jean-pierre@brasserie-saint-clair.com" & @CRLF & _ "contact@biere-privee.com" & @CRLF & _ "Site web : www.brasserie-saint-clair.com" & @CRLF & _ "www.facebook.com/BrasserieSaintClair" & @CRLF & _ "biere-privee.com" & @CRLF & _ "www.facebook.com/biereprivee" & @CRLF & _ "Historique" & @CRLF & _ "Création : août 2017" & @CRLF & _ "L'atelier de brassage Bière Privée est situé sur le même site. Création de bières et étiquettes personnalisées, pour les particuliers et" & @CRLF & _ "professionnels (brassins de 20l, 50l, 200l, 2000l)" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 1000 hl" & @CRLF & _ "2019 : 2000 hl (1)" & @CRLF & _ "" & @CRLF & _ "Jean-Yves Martinal" & @CRLF & _ "Ferme-Brasserie de Belmonthé" & @CRLF & _ "Village de Belmont 01260 BELMONT-LUTHÉZIEU" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 79 87 45 54 Fax : " & @CRLF & _ "Portable :" & @CRLF & _ "Contact : Jean-Yves Martinal" & @CRLF & _ "E-mail : martinal@gmail.com" & @CRLF & _ "Site web :" & @CRLF & _ "Historique" & @CRLF & _ "Création : 2003" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "108 Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr)La bière en France Edition 2020" & @CRLF & _ "" & @CRLF & _ "Two Hats Brewing" & @CRLF & _ "199, route de Savoie 01300 PEYRIEU" & @CRLF & _ "" & @CRLF & _ "Tél. : 09 62 51 59 21 Fax : " & @CRLF & _ "05 47 07 70 40" & @CRLF & _ "Portable :" & @CRLF & _ "Contact : Andy MacLeod, Julia MacLeod" & @CRLF & _ "E-mail : biere@twohatsbrewing.fr" & @CRLF & _ "Site web : www.twohatsbrewing.fr" & @CRLF & _ "www.facebook.com/TwoHatsBrewing" & @CRLF & _ "Historique" & @CRLF & _ "Création : janvier 2018" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 900 hl" & @CRLF & _ "" & @CRLF & _ "La Poulette des Ebaudis" & @CRLF & _ "Lotissement Les Mûres 01310 CURTAFOND" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 61 30 45 55" & @CRLF & _ "Contact : Stive Fructus" & @CRLF & _ "E-mail : lapoulettedesebaudis@gmail.com" & @CRLF & _ "Site web : www.lapoulettedesebaudis.fr" & @CRLF & _ "www.facebook.com/La-Poulette-des-Ebaudis-806059202757473" & @CRLF & _ "Historique" & @CRLF & _ "Création : Printemps 2014" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr) 109Edition 2020 La bière en France" & @CRLF & _ "" & @CRLF & _ "du Revermont" & @CRLF & _ "Les Deux Frères" & @CRLF & _ "745, allée des Artisans - ZA du Chatelard 01310 SAINT-RÉMY" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 23 03 34 75" & @CRLF & _ "Contact : Neli Vizeu" & @CRLF & _ "E-mail : ilen@sfr.fr" & @CRLF & _ "nelly.vizeu@sfr.fr" & @CRLF & _ "infos@brasserielesdeuxfreres.com" & @CRLF & _ "Site web : www.brasserielesdeuxfreres.com" & @CRLF & _ "www.facebook.com/Brasserie-du-Revermont-Les-deux-frères-666157120075310" & @CRLF & _ "Historique" & @CRLF & _ "Création : février 2013" & @CRLF & _ "Ancienne adresse avant avril 2017 : 27, route de Journans 01250 BOHAS-MEYRIAT-RIGNAT" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "Les Bières Hoffmann" & @CRLF & _ "Les Brasseurs du Grand Colombier" & @CRLF & _ "1263, rue du Point Noir 01350 CULOZ" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 25 19 72 79 (Paul)" & @CRLF & _ "06 13 82 79 91 (Cédric)" & @CRLF & _ "Contact : Pierre Hoffmann, Paul Rodriguez" & @CRLF & _ "E-mail : hoffmann@lesbiereshoffmann.com" & @CRLF & _ "paul@brasseurscolombier.fr" & @CRLF & _ "cedric@brasseurscolombier.fr" & @CRLF & _ "Site web : www.lesbiereshoffmann.com" & @CRLF & _ "www.facebook.com/lesbiereshoffmann" & @CRLF & _ "Historique" & @CRLF & _ "Création : juin 2015" & @CRLF & _ "Les Bières Hoffmann ont créé l'enseigne Les Brasseurs du Grand Colombier à la même adresse" & @CRLF & _ " http://brasseurscolombier.fr" & @CRLF & _ " https://www.facebook.com/LesBrasseursGdColombier" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2016 : 30 hl" & @CRLF & _ "2017 : 60 hl" & @CRLF & _ "2018 : 70 hl (1)" & @CRLF & _ "" & @CRLF & _ "110 Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr)La bière en France Edition 2020" & @CRLF & _ "" & @CRLF & _ "de la Pérouze" & @CRLF & _ "Ferme de la Pérouze 01380 BÂGÉ-DOMMARTIN" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable :" & @CRLF & _ "Contact : Jérémy Halm" & @CRLF & _ "E-mail : brasseriedelaperouze@gmail.com" & @CRLF & _ "Site web : www.facebook.com/Brasserie-de-la-P%C3%A9rouze-212321282873442" & @CRLF & _ "Historique" & @CRLF & _ "Création : janvier 2018" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "La Voie Maltée" & @CRLF & _ "17, chemin de Gromelet 01390 SAINT-JEAN-DE-THURIGNEUX" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 74 00 16 27 Fax : " & @CRLF & _ "Portable : 06 08 96 26 29" & @CRLF & _ "Contact : Denis Julliard (brasseur) et Aurélien Clerc" & @CRLF & _ "E-mail : contact@lavoiemaltee.fr" & @CRLF & _ "Site web : www.lavoiemaltee.fr" & @CRLF & _ "www.facebook.com/Brasserie-La-Voie-Malt%C3%A9e-1694057804184202" & @CRLF & _ "Historique" & @CRLF & _ "Création : janvier 2010" & @CRLF & _ "Les premiers brassins en 2010 ont été réalisés dans les locaux de la brasserie La Franche" & @CRLF & _ "Ancienne adresse avant janvier 2012 : Le Village 01390 RANCÉ" & @CRLF & _ "En 2016, départ à la retraite de Yves Boutaric et arrivée d'Aurélien Clerc" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2014 : 500 hl" & @CRLF & _ "2017 : 900 hl" & @CRLF & _ "2018 : 900 hl" & @CRLF & _ "2019 : 900 hl (1)" & @CRLF & _ "" & @CRLF & _ "Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr) 111Edition 2020 La bière en France" & @CRLF & _ "" & @CRLF & _ "La Poule" & @CRLF & _ "113, route de Bourg 01400 NEUVILLE-LES-DAMES" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 52 31 96 36" & @CRLF & _ "Contact : Romuald Saudemon" & @CRLF & _ "E-mail : contact@bierelapoule.fr" & @CRLF & _ "Site web : bierelapoule.fr" & @CRLF & _ "www.facebook.com/bierelapoule" & @CRLF & _ "Historique" & @CRLF & _ "Création : octobre 2018" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2019 : 200 hl (1)" & @CRLF & _ "" & @CRLF & _ "Mac Never's and Co." & @CRLF & _ "29, rue du Clou 01430 MAILLAT" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 68 91 72 66" & @CRLF & _ "Contact : Franck Nevers, Christopher Compagnon" & @CRLF & _ "E-mail : info@macnevers-and-co.beer" & @CRLF & _ "Site web : www.macnevers-and-co.beer" & @CRLF & _ "www.facebook.com/BrasserieMacNeversandCo" & @CRLF & _ "Historique" & @CRLF & _ "Création : juin 2018" & @CRLF & _ "Pas d'historique de production pour cette brasserie" & @CRLF & _ "" & @CRLF & _ "Grange Noire" & @CRLF & _ "10, route de Chamagnat - Le Mortaray 01450 SAINT-ALBAN" & @CRLF & _ "" & @CRLF & _ "Tél. : 04 37 61 04 05 Fax : " & @CRLF & _ "Portable : 06 09 80 50 94" & @CRLF & _ "Contact : Emeline Nottin et Nicolas Blisson (brasseurs et co-gérants)" & @CRLF & _ "E-mail : contact@grangenoire.com" & @CRLF & _ "Site web : grangenoire.com" & @CRLF & _ "www.facebook.com/GrangeNoire" & @CRLF & _ "Historique" & @CRLF & _ "Création : septembre 2019" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2019 : 100 hl" & @CRLF & _ "" & @CRLF & _ "112 Emmanuel Gillard | Projet Amertume (http://projet.amertume.free.fr)La bière en France Edition 2020" & @CRLF & _ "" & @CRLF & _ "Les Bières du Crépuscule" & @CRLF & _ "21, rue Ferrachat 01560 SAINT-JULIEN-SUR-REYSSOUZE" & @CRLF & _ "" & @CRLF & _ "Tél. : Fax : " & @CRLF & _ "Portable : 06 15 33 04 44" & @CRLF & _ "Contact : Vincent Guyot" & @CRLF & _ "E-mail : bieresducrepuscule@gmail.com" & @CRLF & _ "Site web : www.facebook.com/lesbieresducrepuscule" & @CRLF & _ "Historique" & @CRLF & _ "Création : juillet 2013" & @CRLF & _ "Ancienne adresse avant avril 2016 : rue de l'Oume 05500 SAINT-JULIEN-EN-CHAMPSAUR" & @CRLF & _ "Historique de production (1) prévision (2) estimation" & @CRLF & _ "2018 : 15 hl" & @CRLF & _ "" & @CRLF & _ "ÔBrasseur" & @CRLF & _ "45, rue de Genève 01630 SAINT-..." & @CRLF & _ "10/13/2020 14:15:00 => [Info] PROJET BINEBINE execution ended in: 00:00:12" & @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