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]
  • 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

using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-name'>(.+?)<\/.*?-winrate-green"">([\d.]+).%<\/"; string input = @"<tr role=""row"" class=""odd""><td><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Advanced Targeting</span><br>Quest: Plasma Cutter circles an additional time""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Inhibiting Energy</span><br>Phase Bomb can Slow enemies hit""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_w_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Combat Advantage</span><br>Plasma Cutter deals more damage to Slowed targets""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Purification Salvo</span><br>Fire a barrage of homing missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_r_scan.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Auxiliary Shields</span><br>Basic Attacks grant Shields""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Photonic Weaponry</span><br>Shield Capacitor increases damage dealt""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Secondary Fire</span><br>Plasma Cutter can fire Purification Salvo missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span></td><td class=""sortIcon_Number""><span class=""hl-row-height"">363</span></td><td class="" sortIcon_Number""><span class=""hl-row-height"">0.8%<div class=""hsl-percentbar hsl-percentbar-popularity"" style=""width:9.7560975609756%;""></div></span></td><td class=""sortIcon_Number sorting_1""><span class=""hl-row-height""><span class=""hsl-number-winrate-green"">72.5 %</span><div class=""hsl-percentbar hsl-percentbar-winrate"" style=""width:100%;""></div></span></td></tr><tr role=""row"" class=""even""><td><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Advanced Targeting</span><br>Quest: Plasma Cutter circles an additional time""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Inhibiting Energy</span><br>Phase Bomb can Slow enemies hit""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_w_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Combat Advantage</span><br>Plasma Cutter deals more damage to Slowed targets""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Purification Salvo</span><br>Fire a barrage of homing missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_r_scan.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Auxiliary Shields</span><br>Basic Attacks grant Shields""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Arsenal Overcharge</span><br>Basic Attacks reduce Ability cooldowns""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_talent_autoattack_cooldown.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Secondary Fire</span><br>Plasma Cutter can fire Purification Salvo missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span></td><td class=""sortIcon_Number""><span class=""hl-row-height"">547</span></td><td class="" sortIcon_Number""><span class=""hl-row-height"">1.3%<div class=""hsl-percentbar hsl-percentbar-popularity"" style=""width:21.951219512195%;""></div></span></td><td class=""sortIcon_Number sorting_1""><span class=""hl-row-height""><span class=""hsl-number-winrate-green"">70.6 %</span><div class=""hsl-percentbar hsl-percentbar-winrate"" style=""width:89.502762430939%;""></div></span></td></tr><tr role=""row"" class=""odd""><td><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Advanced Targeting</span><br>Quest: Plasma Cutter circles an additional time""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Emergency Protocol</span><br>Gain Move Speed when Shield depletes""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Combat Advantage</span><br>Plasma Cutter deals more damage to Slowed targets""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Purification Salvo</span><br>Fire a barrage of homing missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_r_scan.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Auxiliary Shields</span><br>Basic Attacks grant Shields""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Photonic Weaponry</span><br>Shield Capacitor increases damage dealt""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Secondary Fire</span><br>Plasma Cutter can fire Purification Salvo missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span></td><td class=""sortIcon_Number""><span class=""hl-row-height"">1422</span></td><td class="" sortIcon_Number""><span class=""hl-row-height"">3.3%<div class=""hsl-percentbar hsl-percentbar-popularity"" style=""width:70.731707317073%;""></div></span></td><td class=""sortIcon_Number sorting_1""><span class=""hl-row-height""><span class=""hsl-number-winrate-green"">70.4 %</span><div class=""hsl-percentbar hsl-percentbar-winrate"" style=""width:88.397790055249%;""></div></span></td></tr><tr role=""row"" class=""even""><td><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Mobile Offense</span><br>Movement empowers Basic Attacks""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_w_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Emergency Protocol</span><br>Gain Move Speed when Shield depletes""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Combat Advantage</span><br>Plasma Cutter deals more damage to Slowed targets""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Purification Salvo</span><br>Fire a barrage of homing missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_r_scan.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Auxiliary Shields</span><br>Basic Attacks grant Shields""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Photonic Weaponry</span><br>Shield Capacitor increases damage dealt""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Singularity Charge</span><br>Increase Weapon Mode bonuses""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_w_2.png""></span></span></td><td class=""sortIcon_Number""><span class=""hl-row-height"">246</span></td><td class="" sortIcon_Number""><span class=""hl-row-height"">0.6%<div class=""hsl-percentbar hsl-percentbar-popularity"" style=""width:4.8780487804878%;""></div></span></td><td class=""sortIcon_Number sorting_1""><span class=""hl-row-height""><span class=""hsl-number-winrate-green"">69.9 %</span><div class=""hsl-percentbar hsl-percentbar-winrate"" style=""width:85.635359116022%;""></div></span></td></tr><tr role=""row"" class=""odd""><td><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Advanced Targeting</span><br>Quest: Plasma Cutter circles an additional time""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Emergency Protocol</span><br>Gain Move Speed when Shield depletes""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_1.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Combat Advantage</span><br>Plasma Cutter deals more damage to Slowed targets""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Planet Cracker</span><br>Fire a laser across the battleground""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_r_planet_cracker.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Auxiliary Shields</span><br>Basic Attacks grant Shields""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_shield_2.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Arsenal Overcharge</span><br>Basic Attacks reduce Ability cooldowns""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_talent_autoattack_cooldown.png""></span></span><span class=""paginated-tooltip"" data-toggle=""tooltip"" data-html=""true"" title="" data-original-title=""<span class='hl-talents-tooltip-name'>Secondary Fire</span><br>Plasma Cutter can fire Purification Salvo missiles""><span class=""hl-no-wrap hl-row-height""><img class=""hl-builds-talent-image"" src=""//cdn.hotstat.us/images/storm_ui_icon_fenix_q.png""></span></span></td><td class=""sortIcon_Number""><span class=""hl-row-height"">450</span></td><td class="" sortIcon_Number""><span class=""hl-row-height"">1%<div class=""hsl-percentbar hsl-percentbar-popularity"" style=""width:14.634146341463%;""></div></span></td><td class=""sortIcon_Number sorting_1""><span class=""hl-row-height""><span class=""hsl-number-winrate-green"">69.8 %</span><div class=""hsl-percentbar hsl-percentbar-winrate"" style=""width:85.082872928177%;""></div></span></td></tr>"; foreach (Match m in Regex.Matches(input, pattern)) { Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index); } } }

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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx