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