Regular Expressions 101

Save & Share

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 the latest version of the regex crate in your Cargo.toml extern crate regex; use regex::Regex; fn main() { let regex = Regex::new(r"(?m)\[3\] = {[\s]+title = [^\n]+[\s]+args = {\n(([\s]*{[^\n]+\n)*)[\s]*},[\s]+icon = [\d]+[\s]+},").unwrap(); let string = " [1] = { -- Affliction [1] = { title = L[\"Buffs\"], args = { { spell = 126, type = \"buff\", unit = \"player\"}, -- Eye of Kilrogg { spell = 755, type = \"buff\", unit = \"pet\"}, -- Health Funnel { spell = 5697, type = \"buff\", unit = \"player\"}, -- Unending Breath { spell = 7870, type = \"buff\", unit = \"pet\"}, -- Lesser Invisibility { spell = 17767, type = \"buff\", unit = \"pet\"}, -- Shadow Bulwark { spell = 20707, type = \"buff\", unit = \"group\"}, -- Soulstone { spell = 48018, type = \"buff\", unit = \"player\"}, -- Demonic Circle { spell = 104773, type = \"buff\", unit = \"player\"}, -- Unending Resolve { spell = 108366, type = \"buff\", unit = \"player\"}, -- Soul Leech { spell = 108416, type = \"buff\", unit = \"player\", talent = 9 }, -- Dark Pact { spell = 112042, type = \"buff\", unit = \"pet\"}, -- Threatening Presence { spell = 113860, type = \"buff\", unit = \"player\", talent = 21 }, -- Dark Soul: Misery { spell = 111400, type = \"buff\", unit = \"player\", talent = 8 }, -- Burning Rush { spell = 196099, type = \"buff\", unit = \"player\", talent = 18 }, -- Grimoire of Sacrifice { spell = 264571, type = \"buff\", unit = \"player\", talent = 1 }, -- Nightfall { spell = 334320, type = \"buff\", unit = \"player\", talent = 2 }, -- Inevitable Demise }, icon = 136210 }, [2] = { title = L[\"Debuffs\"], args = { { spell = 702, type = \"debuff\", unit = \"target\"}, -- Curse of Weakness { spell = 710, type = \"debuff\", unit = \"multi\"}, -- Banish { spell = 980, type = \"debuff\", unit = \"target\"}, -- Agony { spell = 1098, type = \"debuff\", unit = \"multi\"}, -- Enslave Demon { spell = 1714, type = \"debuff\", unit = \"target\"}, -- Curse of Tongues { spell = 6358, type = \"debuff\", unit = \"target\"}, -- Seduction { spell = 6360, type = \"debuff\", unit = \"target\"}, -- Whiplash { spell = 6789, type = \"debuff\", unit = \"target\", talent = 14 }, -- Mortal Coil { spell = 17735, type = \"debuff\", unit = \"target\"}, -- Suffering { spell = 27243, type = \"debuff\", unit = \"target\"}, -- Seed of Corruption { spell = 30283, type = \"debuff\", unit = \"target\"}, -- Shadowfury { spell = 48181, type = \"debuff\", unit = \"target\", talent = 17 }, -- Haunt { spell = 63106, type = \"debuff\", unit = \"target\", talent = 6 }, -- Siphon Life { spell = 118699, type = \"debuff\", unit = \"target\"}, -- Fear { spell = 146739, type = \"debuff\", unit = \"target\"}, -- Corruption { spell = 198590, type = \"debuff\", unit = \"target\", talent = 2 }, -- Drain Soul { spell = 205179, type = \"debuff\", unit = \"target\", talent = 11 }, -- Phantom Singularity { spell = 234153, type = \"debuff\", unit = \"target\"}, -- Drain Life { spell = 233490, type = \"debuff\", unit = \"target\"}, -- Unstable Affliction { spell = 278350, type = \"debuff\", unit = \"target\", talent = 12 }, -- Vile Taint { spell = 334275, type = \"debuff\", unit = \"target\"}, -- Curse of Exhaustion }, icon = 136139 }, [3] = { title = L[\"Abilities\"], args = { { spell = 126, type = \"ability\"}, -- Eye of Kilrogg { spell = 172, type = \"ability\", requiresTarget = true, debuff = true}, -- Corruption { spell = 686, type = \"ability\", requiresTarget = true}, -- Shadow Bolt { spell = 698, type = \"ability\"}, -- Ritual of Summoning { spell = 702, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Weakness { spell = 710, type = \"ability\", requiresTarget = true, debuff = true}, -- Banish { spell = 755, type = \"ability\"}, -- Health Funnel { spell = 980, type = \"ability\", requiresTarget = true, debuff = true}, -- Agony { spell = 1714, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Tongues { spell = 3110, type = \"ability\", requiresTarget = true}, -- Firebolt { spell = 3716, type = \"ability\", requiresTarget = true}, -- Consuming Shadows { spell = 5484, type = \"ability\"}, -- Howl of Terror { spell = 5782, type = \"ability\", requiresTarget = true, debuff = true}, -- Fear { spell = 6358, type = \"ability\", requiresTarget = true}, -- Seduction { spell = 6360, type = \"ability\", requiresTarget = true}, -- Whiplash { spell = 6789, type = \"ability\", requiresTarget = true, talent = 14 }, -- Mortal Coil { spell = 7814, type = \"ability\", requiresTarget = true}, -- Lash of Pain { spell = 7870, type = \"ability\"}, -- Lesser Invisibility { spell = 17735, type = \"ability\", requiresTarget = true, debuff = true}, -- Suffering { spell = 17767, type = \"ability\"}, -- Shadow Bulwark { spell = 19505, type = \"ability\", requiresTarget = true}, -- Devour Magic { spell = 19647, type = \"ability\", requiresTarget = true}, -- Spell Lock { spell = 20707, type = \"ability\"}, -- Soulstone { spell = 27243, type = \"ability\", requiresTarget = true}, -- Seed of Corruption { spell = 29893, type = \"ability\"}, -- Create Soulwell { spell = 30108, type = \"ability\", requiresTarget = true}, -- Unstable Affliction { spell = 30283, type = \"ability\"}, -- Shadowfury { spell = 48018, type = \"ability\"}, -- Demonic Circle { spell = 48020, type = \"ability\", usable = true }, -- Demonic Circle: Teleport { spell = 48181, type = \"ability\", requiresTarget = true, debuff = true, talent = 17 }, -- Haunt { spell = 54049, type = \"ability\", requiresTarget = true}, -- Shadow Bite { spell = 63106, type = \"ability\", requiresTarget = true, debuff = true, talent = 6}, -- Siphon Life { spell = 89792, type = \"ability\" }, -- Flee { spell = 89808, type = \"ability\"}, -- Singe Magic { spell = 104773, type = \"ability\", buff = true}, -- Unending Resolve { spell = 108416, type = \"ability\", buff = true, talent = 9 }, -- Dark Pact { spell = 108503, type = \"ability\", talent = 18 }, -- Grimoire of Sacrifice { spell = 111771, type = \"ability\"}, -- Demonic Gateway { spell = 112042, type = \"ability\"}, -- Threatening Presence { spell = 113860, type = \"ability\", buff = true, talent = 21 }, -- Dark Soul: Misery { spell = 119910, type = \"ability\", requiresTarget = true}, -- Command Demon { spell = 198590, type = \"ability\", requiresTarget = true}, -- Drain Soul { spell = 205179, type = \"ability\", requiresTarget = true, debuff = true, talent = 11 }, -- Phantom Singularity { spell = 205180, type = \"ability\", totem = true}, -- Summon Darkglare { spell = 232670, type = \"ability\", requiresTarget = true, overlayGlow = true}, -- Shadow Bolt { spell = 234153, type = \"ability\", requiresTarget = true}, -- Drain Life { spell = 264106, type = \"ability\", requiresTarget = true, talent = 3 }, -- Deathbolt { spell = 264993, type = \"ability\"}, -- Shadow Shield { spell = 278350, type = \"ability\", requiresTarget = true, talent = 12 }, -- Vile Taint { spell = 316099, type = \"ability\", requiresTarget = true }, -- Unstable Affliction { spell = 333889, type = \"ability\" }, -- Fel Domination { spell = 334275, type = \"ability\", debuff = true, requiresTarget = true }, -- Curse of Exhaustion { spell = 342601, type = \"ability\" }, -- Ritual of Doom { spell = 324536, type = \"ability\" }, -- Malefic Rapture }, icon = 135808 }, [4] = {}, [5] = {}, [6] = {}, [7] = { title = L[\"PvP Talents\"], args = { { spell = 199954, type=\"ability\", debuff = true, pvptalent = 9, titleSuffix = L[\"cooldown\"]},-- Bane of Fragility { spell = 199954, type=\"debuff\", unit = \"target\", pvptalent = 9, titleSuffix = L[\"debuff\"]},-- Bane of Fragility { spell = 212295, type=\"ability\", pvptalent = 5, titleSuffix = L[\"cooldown\"]},-- Nether Ward { spell = 212295, type=\"buff\", unit = \"player\", pvptalent = 5, titleSuffix = L[\"buff\"]},-- Nether Ward { spell = 212356, type=\"ability\", pvptalent = 12, titleSuffix = L[\"cooldown\"]},-- Soulshatter { spell = 221703, type=\"ability\", pvptalent = 7, titleSuffix = L[\"cooldown\"]},-- Casting Circle { spell = 221705, type=\"buff\", unit = \"player\", pvptalent = 7, titleSuffix = L[\"buff\"]},-- Casting Circle { spell = 221715, type=\"debuff\", unit = \"target\", pvptalent = 6},-- Essence Drain { spell = 264106, type=\"ability\", pvptalent = 4},-- Deathbolt { spell = 285933, type=\"buff\", unit = \"player\", pvptalent = 13},-- Demon Armor { spell = 234877, type=\"ability\", pvptalent = 4},-- Bane of Shadows { spell = 328774, type=\"ability\", buff = true, pvptalent = 8},-- Amplify Curse }, icon = \"Interface\\\\Icons\\\\Achievement_BG_winWSG\", }, [8] = { title = L[\"Resources\"], args = { }, icon = \"Interface\\\\Icons\\\\inv_misc_gem_amethyst_02\", }, }, [2] = { -- Demonology [1] = { title = L[\"Buffs\"], args = { { spell = 126, type = \"buff\", unit = \"player\"}, -- Eye of Kilrogg { spell = 755, type = \"buff\", unit = \"pet\"}, -- Health Funnel { spell = 5697, type = \"buff\", unit = \"player\"}, -- Unending Breath { spell = 17767, type = \"buff\", unit = \"pet\"}, -- Shadow Bulwark { spell = 20707, type = \"buff\", unit = \"group\"}, -- Soulstone { spell = 30151, type = \"buff\", unit = \"pet\"}, -- Pursuit { spell = 48018, type = \"buff\", unit = \"player\"}, -- Demonic Circle { spell = 89751, type = \"buff\", unit = \"pet\"}, -- Felstorm { spell = 104773, type = \"buff\", unit = \"player\"}, -- Unending Resolve { spell = 108366, type = \"buff\", unit = \"player\"}, -- Soul Leech { spell = 108416, type = \"buff\", unit = \"player\", talent = 9 }, -- Dark Pact { spell = 111400, type = \"buff\", unit = \"player\", talent = 8 }, -- Burning Rush { spell = 134477, type = \"buff\", unit = \"pet\"}, -- Threatening Presence { spell = 205146, type = \"buff\", unit = \"player\", talent = 4 }, -- Demonic Calling { spell = 265273, type = \"buff\", unit = \"player\"}, -- Demonic Power { spell = 267218, type = \"buff\", unit = \"player\", talent = 21 }, -- Nether Portal { spell = 264173, type = \"buff\", unit = \"player\"}, -- Demonic Core { spell = 267171, type = \"buff\", unit = \"pet\", talent = 3 }, -- Demonic Strength }, icon = 1378284 }, [2] = { title = L[\"Debuffs\"], args = { { spell = 603, type = \"debuff\", unit = \"target\"}, -- Doom { spell = 702, type = \"debuff\", unit = \"target\"}, -- Curse of Weakness { spell = 710, type = \"debuff\", unit = \"multi\"}, -- Banish { spell = 1098, type = \"debuff\", unit = \"multi\"}, -- Enslave Demon { spell = 1714, type = \"debuff\", unit = \"target\"}, -- Curse of Tongues { spell = 6358, type = \"debuff\", unit = \"target\"}, -- Seduction { spell = 6360, type = \"debuff\", unit = \"target\"}, -- Whiplash { spell = 6789, type = \"debuff\", unit = \"target\", talent = 14 }, -- Mortal Coil { spell = 17735, type = \"debuff\", unit = \"target\"}, -- Suffering { spell = 30213, type = \"debuff\", unit = \"target\"}, -- Legion Strike { spell = 30283, type = \"debuff\", unit = \"target\"}, -- Shadowfury { spell = 89766, type = \"debuff\", unit = \"target\"}, -- Axe Toss { spell = 118699, type = \"debuff\", unit = \"target\"}, -- Fear { spell = 146739, type = \"debuff\", unit = \"target\"}, -- Corruption { spell = 267997, type = \"debuff\", unit = \"target\", talent = 2 }, -- Bile Spit { spell = 270569, type = \"debuff\", unit = \"target\", talent = 10 }, -- From the Shadows { spell = 234153, type = \"debuff\", unit = \"target\"}, -- Drain Life { spell = 265412, type = \"debuff\", unit = \"target\", talent = 6 }, -- Doom { spell = 334275, type = \"debuff\", unit = \"target\"}, -- Curse of Exhaustion }, icon = 136122 }, [3] = { title = L[\"Abilities\"], args = { { spell = 126, type = \"ability\" }, -- Eyew of Kilrogg { spell = 172, type = \"ability\" }, -- Corruption { spell = 603, type = \"ability\", requiresTarget = true, debuff = true, talent = 6}, -- Doom { spell = 686, type = \"ability\", requiresTarget = true}, -- Shadow Bolt { spell = 698, type = \"ability\"}, -- Ritual of Summoning { spell = 702, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Weakness { spell = 710, type = \"ability\", requiresTarget = true, debuff = true}, -- Banish { spell = 755, type = \"ability\"}, -- Health Funnel { spell = 1098, type = \"ability\"}, -- Subjugate Demon { spell = 1714, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Tongues { spell = 3716, type = \"ability\", requiresTarget = true}, -- Consuming Shadows { spell = 5484, type = \"ability\", debuff = true, talent = 15}, -- Howl of Terror { spell = 5782, type = \"ability\", requiresTarget = true, debuff = true}, -- Fear { spell = 6358, type = \"ability\", requiresTarget = true}, -- Seduction { spell = 6360, type = \"ability\", requiresTarget = true}, -- Whiplash { spell = 6789, type = \"ability\", requiresTarget = true, talent = 14 }, -- Mortal Coil { spell = 7814, type = \"ability\", requiresTarget = true}, -- Lash of Pain { spell = 7870, type = \"ability\"}, -- Lesser Invisibility { spell = 17735, type = \"ability\", requiresTarget = true, debuff = true}, -- Suffering { spell = 17767, type = \"ability\"}, -- Shadow Bulwark { spell = 19505, type = \"ability\", requiresTarget = true}, -- Devour Magic { spell = 19647, type = \"ability\", requiresTarget = true}, -- Spell Lock { spell = 20707, type = \"ability\"}, -- Soulstone { spell = 29893, type = \"ability\"}, -- Create Soulwell { spell = 30151, type = \"ability\", requiresTarget = true}, -- Pursuit { spell = 30213, type = \"ability\", requiresTarget = true}, -- Legion Strike { spell = 30283, type = \"ability\"}, -- Shadowfury { spell = 48018, type = \"ability\" }, -- Demonic Circle { spell = 48020, type = \"ability\" }, -- Demonic Circle: Teleport { spell = 54049, type = \"ability\", requiresTarget = true}, -- Shadow Bite { spell = 89751, type = \"ability\"}, -- Felstorm { spell = 89766, type = \"ability\", requiresTarget = true, debuff = true}, -- Axe Toss { spell = 89792, type = \"ability\"}, -- Flee { spell = 89808, type = \"ability\"}, -- Singe Magic { spell = 104316, type = \"ability\", requiresTarget = true, overlayGlow = true}, -- Call Dreadstalkers { spell = 104773, type = \"ability\", buff = true}, -- Unending Resolve { spell = 105174, type = \"ability\", requiresTarget = true}, -- Hand of Gul'dan { spell = 108416, type = \"ability\", buff = true, talent = 9 }, -- Dark Pact { spell = 111771, type = \"ability\"}, -- Demonic Gateway { spell = 111898, type = \"ability\", requiresTarget = true, talent = 18 }, -- Grimoire: Felguard { spell = 112042, type = \"ability\"}, -- Threatening Presence { spell = 119898, type = \"ability\" }, -- Command Demon { spell = 196277, type = \"ability\" }, -- Implosion { spell = 234153, type = \"ability\", requiresTarget = true }, -- Drain Life { spell = 264057, type = \"ability\", requiresTarget = true, talent = 11 }, -- Soul Strike { spell = 264119, type = \"ability\", talent = 12 }, -- Summon Vilefiend { spell = 264130, type = \"ability\", usable = true, talent = 5 }, -- Power Siphon { spell = 264178, type = \"ability\", requiresTarget = true, overlayGlow = true}, -- Demonbolt { spell = 264993, type = \"ability\"}, -- Shadow Shield { spell = 265187, type = \"ability\"}, -- Summon Demonic Tyrant { spell = 265412, type = \"ability\", requiresTarget = true, debuff = true, talent = 6}, -- Doom { spell = 267171, type = \"ability\", requiresTarget = true, talent = 3 }, -- Demonic Strength { spell = 267211, type = \"ability\", talent = 2 }, -- Bilescourge Bombers { spell = 267217, type = \"ability\", buff = true, talent = 21 }, -- Nether Portal { spell = 333889, type = \"ability\" }, -- Fel Domination { spell = 334275, type = \"ability\", debuff = true }, -- Curse of Exhaustion { spell = 342601, type = \"ability\" }, -- Ritual of Doom }, icon = 1378282 }, [4] = {}, [5] = {}, [6] = {}, [7] = { title = L[\"PvP Talents\"], args = { { spell = 199954, type=\"ability\", debuff = true, pvptalent = 3, titleSuffix = L[\"cooldown\"]},-- Bane of Fragility { spell = 199954, type=\"debuff\", unit = \"target\", pvptalent = 3, titleSuffix = L[\"debuff\"]},-- Bane of Fragility { spell = 201996, type=\"ability\", pvptalent = 9},-- Call Observer { spell = 212295, type=\"ability\", pvptalent = 12, titleSuffix = L[\"cooldown\"]},-- Nether Ward { spell = 212295, type=\"buff\", unit = \"player\", pvptalent = 12, titleSuffix = L[\"buff\"]},-- Nether Ward { spell = 212459, type=\"ability\", pvptalent = 2},-- Call Fel Lord { spell = 212619, type=\"ability\", pvptalent = 6},-- Call Felhunter { spell = 212623, type=\"ability\", pvptalent = 7},-- Singe Magic { spell = 221703, type=\"ability\", pvptalent = 10, titleSuffix = L[\"cooldown\"]},-- Casting Circle { spell = 221705, type=\"buff\", unit = \"target\", pvptalent = 10, titleSuffix = L[\"buff\"]},-- Casting Circle { spell = 221715, type=\"debuff\", unit = \"target\", pvptalent = 11},-- Essence Drain { spell = 328774, type=\"ability\", buff = true, pvptalent = 8},-- Amplify Curse }, icon = \"Interface\\\\Icons\\\\Achievement_BG_winWSG\", }, [8] = { title = L[\"Resources\"], args = { }, icon = \"Interface\\\\Icons\\\\inv_misc_gem_amethyst_02\", }, }, [3] = { -- Destruction [1] = { title = L[\"Buffs\"], args = { { spell = 126, type = \"buff\", unit = \"player\"}, -- Eye of Kilrogg { spell = 755, type = \"buff\", unit = \"pet\"}, -- Health Funnel { spell = 5697, type = \"buff\", unit = \"player\"}, -- Unending Breath { spell = 7870, type = \"buff\", unit = \"pet\"}, -- Lesser Invisibility { spell = 17767, type = \"buff\", unit = \"pet\"}, -- Shadow Bulwark { spell = 20707, type = \"buff\", unit = \"group\"}, -- Soulstone { spell = 48018, type = \"buff\", unit = \"player\"}, -- Demonic Circle { spell = 104773, type = \"buff\", unit = \"player\"}, -- Unending Resolve { spell = 108366, type = \"buff\", unit = \"player\"}, -- Soul Leech { spell = 108366, type = \"buff\", unit = \"pet\"}, -- Soul Leech { spell = 108416, type = \"buff\", unit = \"player\", talent = 9 }, -- Dark Pact { spell = 111400, type = \"buff\", unit = \"player\", talent = 8 }, -- Burning Rush { spell = 112042, type = \"buff\", unit = \"pet\"}, -- Threatening Presence { spell = 113858, type = \"buff\", unit = \"player\", talent = 21 }, -- Dark Soul: Instability { spell = 117828, type = \"buff\", unit = \"player\"}, -- Backdraft { spell = 196099, type = \"buff\", unit = \"player\", talent = 18 }, -- Grimoire of Sacrifice { spell = 266030, type = \"buff\", unit = \"player\", talent = 4 }, -- Reverse Entropy }, icon = 136150 }, [2] = { title = L[\"Debuffs\"], args = { { spell = 172, type = \"debuff\", unit = \"target\"}, -- Coruption { spell = 348, type = \"debuff\", unit = \"target\"}, -- Immolate { spell = 702, type = \"debuff\", unit = \"target\"}, -- Curse of Weakness { spell = 710, type = \"debuff\", unit = \"multi\"}, -- Banish { spell = 1714, type = \"debuff\", unit = \"target\"}, -- Curse of Tongues { spell = 1098, type = \"debuff\", unit = \"multi\"}, -- Enslave Demon { spell = 5782, type = \"debuff\", unit = \"target\"}, -- Fear { spell = 6358, type = \"debuff\", unit = \"target\"}, -- Seduction { spell = 6360, type = \"debuff\", unit = \"target\"}, -- Whiplash { spell = 6789, type = \"debuff\", unit = \"target\", talent = 14 }, -- Mortal Coil { spell = 17735, type = \"debuff\", unit = \"target\"}, -- Suffering { spell = 22703, type = \"debuff\", unit = \"target\"}, -- Infernal Awakening { spell = 30283, type = \"debuff\", unit = \"target\"}, -- Shadowfury { spell = 80240, type = \"debuff\", unit = \"target\"}, -- Havoc { spell = 118699, type = \"debuff\", unit = \"target\"}, -- Fear { spell = 157736, type = \"debuff\", unit = \"target\"}, -- Immolate { spell = 196414, type = \"debuff\", unit = \"target\", talent = 2 }, -- Eradication { spell = 234153, type = \"debuff\", unit = \"target\"}, -- Drain Life { spell = 265931, type = \"debuff\", unit = \"target\"}, -- Conflagrate { spell = 334275, type = \"debuff\", unit = \"target\"}, -- Curse of Exhaustion }, icon = 135817 }, [3] = { title = L[\"Abilities\"], args = { { spell = 126, type = \"ability\"}, -- Eye of Kilrogg { spell = 172, type = \"ability\", requiresTarget = true, debuff = true}, -- Corruption { spell = 348, type = \"ability\", requiresTarget = true, debuff = true}, -- Immolate { spell = 686, type = \"ability\"}, -- Incinerate { spell = 698, type = \"ability\"}, -- Ritual of Summoning { spell = 702, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Weakness { spell = 710, type = \"ability\", requiresTarget = true, debuff = true}, -- Banish { spell = 1098, type = \"ability\"}, -- Subjugate Demon { spell = 1122, type = \"ability\", duration = 30}, -- Summon Infernal { spell = 1714, type = \"ability\", requiresTarget = true, debuff = true}, -- Curse of Tongues { spell = 3110, type = \"ability\", requiresTarget = true}, -- Firebolt { spell = 3716, type = \"ability\", requiresTarget = true}, -- Consuming Shadows { spell = 5484, type = \"ability\"}, -- Howl of Terror { spell = 5740, type = \"ability\"}, -- Rain of Fire { spell = 5782, type = \"ability\", requiresTarget = true, debuff = true}, -- Fear { spell = 6353, type = \"ability\", talent = 3 }, -- Soul Fire { spell = 6358, type = \"ability\", requiresTarget = true}, -- Seduction { spell = 6360, type = \"ability\", requiresTarget = true}, -- Whiplash { spell = 6789, type = \"ability\", requiresTarget = true, talent = 14 }, -- Mortal Coil { spell = 7814, type = \"ability\", requiresTarget = true}, -- Lash of Pain { spell = 7870, type = \"ability\"}, -- Lesser Invisibility { spell = 17735, type = \"ability\", requiresTarget = true, debuff = true}, -- Suffering { spell = 17767, type = \"ability\"}, -- Shadow Bulwark { spell = 17877, type = \"ability\", requiresTarget = true, charges = true, talent = 6 }, -- Shadowburn { spell = 17962, type = \"ability\", requiresTarget = true, charges = true}, -- Conflagrate { spell = 19647, type = \"ability\", requiresTarget = true}, -- Spell Lock { spell = 20707, type = \"ability\"}, -- Soulstone { spell = 29722, type = \"ability\", requiresTarget = true}, -- Incinerate { spell = 29893, type = \"ability\"}, -- Create Soulwell { spell = 30283, type = \"ability\"}, -- Shadowfury { spell = 48018, type = \"ability\"}, -- Demonic Circle { spell = 48020, type = \"ability\"}, -- Demonic Circle: Teleport { spell = 54049, type = \"ability\", requiresTarget = true}, -- Shadow Bite { spell = 80240, type = \"ability\", requiresTarget = true, debuff = true}, -- Havoc { spell = 89792, type = \"ability\"}, -- Flee { spell = 89808, type = \"ability\"}, -- Singe Magic { spell = 104773, type = \"ability\", buff = true}, -- Unending Resolve { spell = 108416, type = \"ability\", buff = true, talent = 9 }, -- Dark Pact { spell = 108503, type = \"ability\", talent = 18 }, -- Grimoire of Sacrifice { spell = 111771, type = \"ability\"}, -- Demonic Gateway { spell = 112042, type = \"ability\"}, -- Threatening Presence { spell = 113858, type = \"ability\", buff = true, talent = 21 }, -- Dark Soul: Instability { spell = 116858, type = \"ability\" }, -- Chaos Bolt { spell = 119898, type = \"ability\" }, -- Dark Command Demon { spell = 152108, type = \"ability\", talent = 12 }, -- Cataclysm { spell = 116858, type = \"ability\", requiresTarget = true}, -- Chaos Bolt { spell = 196447, type = \"ability\", usable = true, talent = 20 }, -- Channel Demonfire { spell = 234153, type = \"ability\", requiresTarget = true}, -- Drain Life { spell = 264993, type = \"ability\"}, -- Shadow Shield { spell = 333889, type = \"ability\" }, -- Fel Domination { spell = 334275, type = \"ability\", debuff = true, requiresTarget = true }, -- Curse of Exhaustion }, icon = 135807 }, [4] = {}, [5] = {}, [6] = {}, [7] = { title = L[\"PvP Talents\"], args = { { spell = 199954, type=\"ability\", debuff = true, pvptalent = 4, titleSuffix = L[\"cooldown\"]},-- Bane of Fragility { spell = 199954, type=\"debuff\", unit = \"target\", pvptalent = 4, titleSuffix = L[\"debuff\"]},-- Bane of Fragility { spell = 200546, type=\"ability\", pvptalent = 5, titleSuffix = L[\"cooldown\"]},-- Bane of Havoc { spell = 200548, type=\"debuff\", unit = \"target\", pvptalent = 5, titleSuffix = L[\"debuff\"]},-- Bane of Havoc { spell = 200587, type=\"debuff\", unit = \"target\", pvptalent = 10},-- Fel Fissure { spell = 212295, type=\"ability\", pvptalent = 6, titleSuffix = L[\"cooldown\"]},-- Nether Ward { spell = 212295, type=\"buff\", unit = \"player\", pvptalent = 6, titleSuffix = L[\"buff\"]},-- Nether Ward { spell = 221703, type=\"ability\", pvptalent = 8, titleSuffix = L[\"cooldown\"]},-- Casting Circle { spell = 221705, type=\"buff\", unit = \"target\", pvptalent = 8, titleSuffix = L[\"buff\"]},-- Casting Circle { spell = 221715, type=\"debuff\", unit = \"target\", pvptalent = 7},-- Essence Drain { spell = 285933, type=\"buff\", unit = \"target\", pvptalent = 2},-- Demon Armor { spell = 328774, type=\"ability\", buff = true, pvptalent = 3},-- Amplify Curse }, icon = \"Interface\\\\Icons\\\\Achievement_BG_winWSG\", }, [8] = { title = L[\"Resources\"], args = { }, icon = \"Interface\\\\Icons\\\\inv_misc_gem_amethyst_02\", }, }, } "; // result will be an iterator over tuples containing the start and end indices for each match in the string let result = regex.captures_iter(string); for mat in result { println!("{:?}", mat); } }

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 Rust, please visit: https://docs.rs/regex/latest/regex/