Regular Expressions 101

Save & Share

  • Regex Version: ver. 5
  • 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

using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"^(К?[0-9, ()м]+) (?:Ламінат|Акція Ламінат) ([A-Za-z0-9\/( .]*[\d)]) (.+?)(?: \(\d|\s*$)"; string input = @"3924 Ламінат Parfe Floor 7/32 Дуб Мірандо (2,663)/10шт 8199 Ламінат 8 Variostep Classic Дуб Альпійський (2,22м2)/9 шт. 8766 Акція Ламінат 8 Венге Кіото (2,22м2)/9 шт. К395 Акція Ламінат 8 Дуб Торнадо (2,22 м2)/9 шт. 34 818 Ламінат The BRUSH 8 Дуб Бежевий (1,996 м2)/8шт 31 506 (32 065) Ламінат Neutral 4V (Trend world) Дуб Монумент (Дуб Дерби) (1,996 м2)/8шт 27 610 (41404 (8мм) Ламінат Discovery 4V 10/32 Дуб Верден сніжний (1,646 м2)/8 шт 145 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Модерн Білий 33 680 Ламінат Extr. dynamic 8 Старий дуб Полліно фас. (1,996 м2)/8шт 53 687 Ламінат Ambience 4V WR 10/33 Wolta Oak (1,624 м2)/8шт. 60 040 Ламінат Vitality Deluxe 4V 8/32 Дуб Берлі (2.162 м2)/9шт. 60 328 Ламінат Vitality Deluxe 4V 8/32 Дуб Амбарний (2.162 м2)/9шт. 60 491 Ламінат Vitality Deluxe 4V 8/32 Дуб Вибілений (2.162 м2)/9шт. 60 542 Ламінат Vitality Deluxe 4V 8/32 Дуб Елегантний (2.162 м2)/9шт. 60 544 Ламінат Vitality Deluxe 4V 8/32 Горіх Селект (2.162 м2)/9шт. 60 581 Ламінат Vitality Deluxe 4V 8/32 Дуб Суперіор (2.162 м2)/9шт. 60 583 Ламінат Vitality Deluxe 4V 8/32 Дуб лакований натур. (2.162 м2)/9шт. 60 584 Ламінат Vitality Deluxe 4V 8/32 Дуб Авеню (2.162 м2)/9шт. 60 619 Ламінат Vitality Deluxe 4V 8/32 Дуб Білий промаслений (2.162 м2)/9шт. 60 624 Ламінат Vitality Deluxe 4V 8/32 Ясень садовий (2.162 м2)/9шт. 60 796 Ламінат Vitality Deluxe 4V 8/32 Дуб пісочний (2.162 м2)/9шт. 60 900 Ламінат Vitality Deluxe 4V 8/32 Дуб сірувато-димчастий (2.162 м2)/9шт. 60 902 Ламінат Vitality Deluxe 4V 8/32 Дуб Iпанема (2.162 м2)/9шт. 60 903 Ламінат Vitality Deluxe 4V 8/32 Дуб Замшевий (2.162 м2)/9шт. 60 904 Ламінат Vitality Deluxe 4V 8/32 Дуб Сумі (2.162 м2)/9шт. 60 909 Ламінат Vitality Deluxe 4V 8/32 Дуб ретушований (2.162 м2)/9шт. Vitality Style 4V 135 Ламінат Vitality Style 4V 8/32 Дуб Дуб Вибілений Сонячний (2.179 м2)/9шт 137 Ламінат Vitality Style 4V 8/32 Дуб Вікторіанський Коричневий (2.179 м2)/9шт 138 Ламінат Vitality Style 4V 8/32 Дуб Натуральний Бежевий (2.179 м2)/9шт 145 Ламінат Vitality Style 4V 8/32 Дуб Модерн Білий (2.179 м2)/9шт 148 Ламінат Vitality Style 4V 8/32 Дуб Чорний (2.179 м2)/9шт 174 Ламінат Vitality Style 4V 8/32 Дуб Медовий (2.179 м2)/9шт 177 Ламінат Vitality Style 4V 8/32 Дуб Морозний (2.179 м2)/9шт 178 Ламінат Vitality Style 4V 8/32 Дуб Модерн Вишуканий (2.179 м2)/9шт 179 Ламінат Vitality Style 4V 8/32 Дуб Гірський Сірий (2.179 м2)/9шт 135 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Дуб Вибілений Сонячний 137 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Вікторіанський Коричневий 138 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Натуральний Бежевий 145 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Модерн Білий 148 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Чорний 149 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Сірий океан 174 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Медовий 175 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Брендон 177 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Морозний 178 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Модерн Вишуканий 179 Ламінат Vitality Style Aqua Protect 4V 8/32 Дуб Гірський Сірий "; RegexOptions options = RegexOptions.Multiline; foreach (Match m in Regex.Matches(input, pattern, options)) { 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