Regular Expressions 101

Save & Manage Regex

  • Current Version: 1
  • Save & Share
  • Community Library

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
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]
  • Character class intersection
    [\w&&[^\d]]
  • 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
Processing...

Test String

Code Generator

Generated Code

const regex = /"(?<email>[^"@]+@[^"]+)"/g; // Alternative syntax using RegExp constructor // const regex = new RegExp('"(?<email>[^"@]+@[^"]+)"', 'g') const str = `{ "data": [ { "einsatzId": "0016a0ea-f5db-4e1d-9c87-cc616111aec1", "einsatzProjektId": "87a7143b-a4b7-4dd9-bbdc-5d32fb42bea3", "einsatzJobId": "2c5e540b-5d19-4779-9d0f-ea2a9c1bf5dd", "einsatzTerminId": "60262a68-8dd8-4bf2-baaa-a8d02740ac56", "einsatzProfilId": "1f139fa6-d14c-4f0c-84df-ff1e81cecd5d", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "10:55", "einsatzCheckOut": "19:17", "einsatzKategorien": "", "profil": { "profilId": "1f139fa6-d14c-4f0c-84df-ff1e81cecd5d", "profilPersonalnummer": "47594", "profilStatus": "aktiv", "profilEmail": "xxx@gmail.com" } }, { "einsatzId": "00251e08-245b-44c3-9660-6e0c10fa4f8d", "einsatzProjektId": "a985aa5f-8658-4887-b629-174289e5c489", "einsatzJobId": "9ae9147a-b74a-4cf1-952d-7d45dc6a22d8", "einsatzTerminId": "a0b9a0d0-baae-4548-b4f2-76ddbfc66f35", "einsatzProfilId": "bdc601b9-997b-48a2-91c2-b93a3e95988c", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "14:48", "einsatzCheckOut": "21:03", "einsatzKategorien": "", "profil": { "profilId": "bdc601b9-997b-48a2-91c2-b93a3e95988c", "profilPersonalnummer": "84595", "profilStatus": "aktiv", "profilEmail": "xxx@xxx.koeln" } }, { "einsatzId": "002926ab-d9dd-43bc-899a-36b4593b197a", "einsatzProjektId": "e4d16ffd-34b4-471d-9de1-aae50b8a522d", "einsatzJobId": "d65efcd0-9f51-465c-b5e1-cf4ba90ee5de", "einsatzTerminId": "57574589-fa24-421a-a1b6-d193defe32ae", "einsatzProfilId": "329fb255-45af-4d31-87b8-94c6dff46675", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": null, "einsatzCheckOut": null, "einsatzKategorien": "Abr. Einsatzstundennachweis überprüft", "profil": { "profilId": "329fb255-45af-4d31-87b8-94c6dff46675", "profilPersonalnummer": "90809", "profilStatus": "aktiv", "profilEmail": "xxx@gmail.com" } }, { "einsatzId": "00c77ce3-ce53-4010-9711-95f6fb152dcb", "einsatzProjektId": "e4d16ffd-34b4-471d-9de1-aae50b8a522d", "einsatzJobId": "eaa4bf78-e17e-43ae-9bdf-d4aac355b3fa", "einsatzTerminId": "94ee0261-17ce-422a-b9db-a774eff447a0", "einsatzProfilId": "329fb255-45af-4d31-87b8-94c6dff46675", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "10:49", "einsatzCheckOut": "18:00", "einsatzKategorien": "Abr. Einsatzstundennachweis überprüft", "profil": { "profilId": "329fb255-45af-4d31-87b8-94c6dff46675", "profilPersonalnummer": "90809", "profilStatus": "aktiv", "profilEmail": "xxx@gmail.com" } }, { "einsatzId": "00e254cc-a1c9-4bb7-b82f-fb7f2abd9a9a", "einsatzProjektId": "e4d16ffd-34b4-471d-9de1-aae50b8a522d", "einsatzJobId": "eaa4bf78-e17e-43ae-9bdf-d4aac355b3fa", "einsatzTerminId": "9b6e3597-2c15-4ae5-9b94-4d1ac9d1dd2f", "einsatzProfilId": "9d3ffa9b-bcb4-4986-a962-431e67a4a176", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "11:02", "einsatzCheckOut": "18:06", "einsatzKategorien": "", "profil": { "profilId": "9d3ffa9b-bcb4-4986-a962-431e67a4a176", "profilPersonalnummer": "61408", "profilStatus": "aktiv", "profilEmail": "xxx@gmail.com" } }, { "einsatzId": "014b125f-8917-41c2-9454-5067bd0bb602", "einsatzProjektId": "01d15006-4de2-4b16-b736-86732fa5f893", "einsatzJobId": "5d444443-e727-4ca5-9deb-b9a313b14335", "einsatzTerminId": "252b9bb8-dea3-47aa-b7d4-a9517bb16f46", "einsatzProfilId": "5b90bf1d-40c6-4f78-947b-a496cb3a4d31", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "14:41", "einsatzCheckOut": "21:10", "einsatzKategorien": "", "profil": { "profilId": "5b90bf1d-40c6-4f78-947b-a496cb3a4d31", "profilPersonalnummer": "83465", "profilStatus": "aktiv", "profilEmail": "mwipplinger99@gmail.com" } }, { "einsatzId": "019d7918-294c-4b95-a1ba-cd6c332569cf", "einsatzProjektId": "87a7143b-a4b7-4dd9-bbdc-5d32fb42bea3", "einsatzJobId": "f2e232d1-22af-432d-9220-b3e683d0628a", "einsatzTerminId": "2e0b23c1-e9f5-4b13-aa42-86b4476b2ce2", "einsatzProfilId": "1ddd2f87-84e9-4128-832a-98e990f100a6", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "10:11", "einsatzCheckOut": "19:12", "einsatzKategorien": "", "profil": { "profilId": "1ddd2f87-84e9-4128-832a-98e990f100a6", "profilPersonalnummer": "51669", "profilStatus": "aktiv", "profilEmail": "adxxx@gmx.de" } }, { "einsatzId": "01e894c7-cf61-47b7-8511-baff1c9e31f5", "einsatzProjektId": "e4d16ffd-34b4-471d-9de1-aae50b8a522d", "einsatzJobId": "eaa4bf78-e17e-43ae-9bdf-d4aac355b3fa", "einsatzTerminId": "25175bf9-9969-4c57-acac-73c2c975b98f", "einsatzProfilId": "730d75cd-9f92-4d11-8c77-977c586a53ec", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "10:53", "einsatzCheckOut": "18:10", "einsatzKategorien": "", "profil": { "profilId": "730d75cd-9f92-4d11-8c77-977c586a53ec", "profilPersonalnummer": "87801", "profilStatus": "aktiv", "profilEmail": "xxx@gmx.de" } }, { "einsatzId": "01ebf0d0-7564-4f27-bcfc-c7b0714db028", "einsatzProjektId": "a985aa5f-8658-4887-b629-174289e5c489", "einsatzJobId": "9ae9147a-b74a-4cf1-952d-7d45dc6a22d8", "einsatzTerminId": "8a42f4e6-7695-4a81-a449-bdfde63bd6f5", "einsatzProfilId": "ee3c9879-d3c5-4495-957d-41cb6da8ea8c", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "06:39", "einsatzCheckOut": "13:04", "einsatzKategorien": "", "profil": { "profilId": "ee3c9879-d3c5-4495-957d-41cb6da8ea8c", "profilPersonalnummer": "91934", "profilStatus": "aktiv", "profilEmail": "xxx@xxx.de" } }, { "einsatzId": "029fc0be-6138-40ae-a664-bf189ab152f3", "einsatzProjektId": "01d15006-4de2-4b16-b736-86732fa5f893", "einsatzJobId": "5d444443-e727-4ca5-9deb-b9a313b14335", "einsatzTerminId": "075eedb6-a3c6-49bc-b57e-5a02c0777aa8", "einsatzProfilId": "189eaea2-996f-4d62-91e2-ebcc2341328b", "einsatzEinsatzstatus": "Einsatz wurde gebucht", "einsatzCheckIn": "14:54", "einsatzCheckOut": "20:59", "einsatzKategorien": "", "profil": { "profilId": "189eaea2-996f-4d62-91e2-ebcc2341328b", "profilPersonalnummer": "74983", "profilStatus": "aktiv", "profilEmail": "xxx.xxx@gmail.com" } } ] }`; // Reset `lastIndex` if this regex is defined globally // regex.lastIndex = 0; let m; while ((m = regex.exec(str)) !== null) { // This is necessary to avoid infinite loops with zero-width matches if (m.index === regex.lastIndex) { regex.lastIndex++; } // The result can be accessed through the `m`-variable. m.forEach((match, groupIndex) => { console.log(`Found match, group ${groupIndex}: ${match}`); }); }

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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions