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

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