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
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
Processing...

Test String

Code Generator

Generated Code

using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"r'\d{10}'"; string input = @"{""type"": ""text"", ""bbox"": [146, 301, 1118, 1619], ""res"": [{""text"": ""H2nh th\u1ee9c s\u1edf h\u1eefu v\u1ed1n"", ""confidence"": 0.9523688554763794, ""text_region"": [[185.0, 344.0], [431.0, 344.0], [431.0, 372.0], [185.0, 372.0]]}, {""text"": ""T\u1ed5ng C\u00f4ng ty C\u1ea3ng H\u00e0ng kh\u00f4ng Vi\u1ec7t Nam - CTCP(g\u1ecdi t\u1eaft l\u00e0\""T\u1ed5ng C\u00f4ng ty), l\u00e0"", ""confidence"": 0.9614211916923523, ""text_region"": [[185.0, 401.0], [1101.0, 401.0], [1101.0, 434.0], [185.0, 434.0]]}, {""text"": ""c\u00f4ng ty c\u1ed5 ph\u1ea7n, \u0111\u01b0\u1ee3c c\u1ed5 ph\u1ea7n h\u00f3a t\u1eeb Doanh nghi\u1ec7p Nh\u00e0 n\u01b0\u1edbc - T\u1ed5ng C\u00f4ng ty C\u1ea3ng"", ""confidence"": 0.974237859249115, ""text_region"": [[181.0, 431.0], [1101.0, 433.0], [1101.0, 466.0], [181.0, 464.0]]}, {""text"": ""H\u00e0ng kh\u00f4ng Vi\u1ec7t Nam (C\u00f4ng ty tr\u00e1ch nhi\u1ec7m h\u1eefu h\u1ea1n m\u1ed9t th\u00e0nh vi\u00ean), theo Quy\u1ebft \u0111\u1ecbnh"", ""confidence"": 0.9749579429626465, ""text_region"": [[181.0, 461.0], [1099.0, 463.0], [1099.0, 496.0], [181.0, 495.0]]}, {""text"": ""s\u1ed11710/Q\u0110-TTg ng\u00e0y 06 th\u00e1ng 10 n\u0103m 2015 c\u1ee7aTh\u1ee7 t\u01b0\u1edbng Ch\u00ednh ph\u1ee7, ho\u1ea1t \u0111\u1ed9ng"", ""confidence"": 0.9510553479194641, ""text_region"": [[181.0, 491.0], [1101.0, 495.0], [1101.0, 528.0], [181.0, 525.0]]}, {""text"": ""theo Gi\u1ea5y ch\u1ee9ng nh\u1eadn \u0111\u0103ng k\u00fd doanh nghi\u1ec7p s\u1ed10311638525 ng\u00e0y 22 th\u00e1ng 3 n\u0103m"", ""confidence"": 0.9323961138725281, ""text_region"": [[185.0, 525.0], [1097.0, 525.0], [1097.0, 553.0], [185.0, 553.0]]}, {""text"": ""2012 v\u00e0 c\u00e1c Gi\u1ea5y ch\u1ee9ng nh\u1eadn \u0111\u0103ng k\u00fd doanh nghi\u1ec7p \u0111i\u1ec1u chinh.Gi\u1ea5y ch\u1ee9ng nh\u1eadn"", ""confidence"": 0.9408513307571411, ""text_region"": [[185.0, 557.0], [1097.0, 557.0], [1097.0, 585.0], [185.0, 585.0]]}, {""text"": ""\u0111\u0103ng k\u00fd doanh nghi\u1ec7p \u0111i\u1ec1u chinh m\u1edbi nh\u1ea5t l\u1ea7n th\u1ee9 8 ng\u00e0y 15 th\u00e1ng 8 n\u1ea7m 2018 do S\u1edf"", ""confidence"": 0.9612582921981812, ""text_region"": [[183.0, 583.0], [1101.0, 585.0], [1101.0, 619.0], [183.0, 617.0]]}, {""text"": ""K\u1ebf ho\u1ea1ch v\u00e0 \u0110\u1ea7u t\u01b0 Th\u00e0nh ph\u1ed1 H\u1ed3 Ch\u00ed Minh c\u1ea5p."", ""confidence"": 0.9700883626937866, ""text_region"": [[181.0, 613.0], [708.0, 615.0], [708.0, 649.0], [181.0, 647.0]]}, {""text"": ""Ng\u00e0y 12/11/2018,B\u1ed9 Giao th\u00f4ng V\u1eadn t\u1ea3i \u0111\u00e3 chuy\u1ec3n giao quy\u1ec1n \u0111\u1ea1i di\u1ec7n ch\u1ee7 s\u1edf h\u1eefu v\u1ed1n nh\u00e0"", ""confidence"": 0.9736440181732178, ""text_region"": [[185.0, 675.0], [1099.0, 675.0], [1099.0, 704.0], [185.0, 704.0]]}, {""text"": ""n\u01b0\u1edbc t\u1ea1i ACV v\u1ec1 cho Uy Ban Qu\u1ea3n l\u00fd v\u1ed1n Nh\u00e0 n\u01b0\u1edbc t\u1ea1i Doanh nghi\u1ec7p theo quy \u0111\u1ecbnh t\u1ea1i Ngh\u1ecb"", ""confidence"": 0.9769458770751953, ""text_region"": [[185.0, 704.0], [1097.0, 704.0], [1097.0, 732.0], [185.0, 732.0]]}, {""text"": ""\u0111\u1ecbnh s\u1ed1 131/2018/N\u0110-CP ng\u00e0y 29/09/2018 v\u00e0 Quy\u1ebft \u0111\u1ecbnh s\u1ed1 1515/QD-TTg ng\u00e0y 09/11/2018."", ""confidence"": 0.9572672843933105, ""text_region"": [[187.0, 732.0], [1090.0, 732.0], [1090.0, 761.0], [187.0, 761.0]]}, {""text"": ""T\u00ean gi \u0111\u1ea7y \u0111\u1ee7 b\u1eafng ti\u1ebfng Vi\u1ec7t: T\u1ed5ng C\u00f4ng ty C\u1ea3ng H\u00e0ng kh\u00f4ng Vi\u1ec7t Nam -CTCP."", ""confidence"": 0.9677777290344238, ""text_region"": [[185.0, 789.0], [1067.0, 789.0], [1067.0, 823.0], [185.0, 823.0]]}, {""text"": ""T\u00ean giao d\u1ecbch Qu\u1ed1c t\u1ebf: Airports Corporat\u00econ o\u00ed Vietnam."", ""confidence"": 0.9640689492225647, ""text_region"": [[187.0, 853.0], [780.0, 853.0], [780.0, 881.0], [187.0, 881.0]]}, {""text"": ""T\u00ean vi\u1ebft t\u1eaft:ACV."", ""confidence"": 0.9815711975097656, ""text_region"": [[183.0, 910.0], [383.0, 910.0], [383.0, 943.0], [183.0, 943.0]]}, {""text"": ""Tr\u1ee5 s\u1edf ch\u00ednh: S\u1ed1 58 Tr\u01b0\u1eddng S\u01a1n, Ph\u01b0\u1eddng 2, Qu\u1eadn T\u00e2n B\u00ecnh, Th\u00e0nh ph\u1ed1 H\u1ed3 Ch\u00ed Minh."", ""confidence"": 0.9652988910675049, ""text_region"": [[183.0, 970.0], [1090.0, 968.0], [1090.0, 1002.0], [183.0, 1003.0]]}, {""text"": ""C\u1ed5 phi\u1ebfu c\u1ee7a T\u1ed5ng C\u00f4ng ty \u0111\u01b0\u1ee3c giao d\u1ecbch tr\u00ean th\u1ecb tr\u01b0\u1eddng UPCOM t\u1eeb ng\u00e0y 21 th\u00e1ng"", ""confidence"": 0.9594874382019043, ""text_region"": [[185.0, 1032.0], [1105.0, 1032.0], [1105.0, 1066.0], [185.0, 1066.0]]}, {""text"": ""11n\u0103m 2016, v\u1edbi m\u0103 ch\u01b0mg kho\u00e1n .ACV."", ""confidence"": 0.8801693320274353, ""text_region"": [[185.0, 1066.0], [643.0, 1066.0], [643.0, 1094.0], [185.0, 1094.0]]}, {""text"": ""Ng\u00e0nh ngh\u1ec1 kinh doanh v\u00e0 ho\u1ea1t \u0111\u1ed9ng ch\u00ednh"", ""confidence"": 0.9726917147636414, ""text_region"": [[180.0, 1128.0], [665.0, 1128.0], [665.0, 1156.0], [180.0, 1156.0]]}, {""text"": ""Theo Gi\u1ea5y ch\u01b0ng nh\u1eadn \u0111\u0103ng k\u00fd doanh nghi\u1ec7p thay \u0111\u1ed5i,T\u1ed5ng C\u00f4ng ty \u0111\u00e3 \u0111\u0103ng k\u00fd c\u00e1c"", ""confidence"": 0.9440533518791199, ""text_region"": [[181.0, 1183.0], [1101.0, 1179.0], [1101.0, 1216.0], [182.0, 1220.0]]}, {""text"": ""ho\u1ea1t \u0111\u1ed9ng kinh \u0111oanh ch\u00ednh trong c\u00e1c l\u0129nh v\u01b0c sau:"", ""confidence"": 0.9525245428085327, ""text_region"": [[187.0, 1222.0], [724.0, 1222.0], [724.0, 1245.0], [187.0, 1245.0]]}, {""text"": ""Ho\u1ea1t \u0111\u1ed9ng d\u1ecbch v\u1ee5 h\u1ed7 tr\u1ee3 tr\u1ef1c ti\u1ebfp cho v\u1eadn t\u1ea3i h\u00e0ng kh\u00f4ng: \u0110\u1ea7u t\u01b0, qu\u1ea3n l\u00fd v\u1ed1n"", ""confidence"": 0.9798429608345032, ""text_region"": [[242.0, 1277.0], [1099.0, 1273.0], [1099.0, 1307.0], [243.0, 1310.0]]}, {""text"": ""\u0111\u1ea7u t\u01b0, tr\u1ef1c ti\u1ebfp s\u1ea3n xu\u1ea5t, kinh doanh t\u1ea1i c\u00e1c c\u1ea3ng h\u00e0ng kh\u00f4ng s\u00e2n bay: \u0111\u1ea7u t\u01b0, khai"", ""confidence"": 0.9759737849235535, ""text_region"": [[183.0, 1307.0], [1101.0, 1305.0], [1101.0, 1339.0], [183.0, 1340.0]]}, {""text"": ""th\u00e1c k\u1ebft c\u1ea5u h\u1ea1 t\u1ea7ng trang b\u1ecb, thi\u1ebft b\u1ecb c\u1ea3ng h\u00e0ng kh\u00f4ng s\u00e2n bay: cung c\u1ea5p d\u1ecbch v\u1ee5 b\u00e1o"", ""confidence"": 0.9767631888389587, ""text_region"": [[183.0, 1339.0], [1101.0, 1335.0], [1101.0, 1369.0], [183.0, 1372.0]]}, {""text"": ""\u0111\u1ea3m an ninh h\u00e0ng kh\u00f4ng, an to\u00e0n h\u00e0ng kh\u00f4ng: cung \u1eefng c\u00e1c d\u1ecbch v\u1ee5 b\u1ea3o d\u01b0\u1edfng t\u00e0u"", ""confidence"": 0.971575140953064, ""text_region"": [[183.0, 1369.0], [1101.0, 1365.0], [1101.0, 1399.0], [183.0, 1402.0]]}, {""text"": ""bay, ph\u1ee5 t\u1eebng, thi\u1ebft b\u1ecb h\u1ea3ng kh\u00f4ng v\u00e0 c\u00e1c trang thi\u1ebft b\u1ecb kh\u00e1c: cung \u01b0ng c\u00e1c d\u1ecbch v\u1ee5 k\u1ef9"", ""confidence"": 0.9634244441986084, ""text_region"": [[181.0, 1399.0], [1099.0, 1395.0], [1099.0, 1429.0], [181.0, 1433.0]]}, {""text"": ""thu\u1eadt, d\u1ecbch v\u1ee5 khoa h\u1ecdc, c\u00f4ng ngh\u1ec7 trong v\u00e0 ngo\u00e0i n\u01b0\u1edbc: cung \u01b0ng c\u00e1c d\u1ecbch v\u1ee5 k\u1ef9 thu\u1eadt"", ""confidence"": 0.9615932703018188, ""text_region"": [[183.0, 1431.0], [1101.0, 1425.0], [1101.0, 1457.0], [183.0, 1463.0]]}, {""text"": ""th\u01b0\u01a1ng m\u1ea1i m\u1eb7t \u0111\u1ea5t: c\u00e1c d\u1ecbch v\u1ee5 t\u1ea1i nh\u00e0 ga h\u00e0nh kh\u00e1ch, ga h\u00e0ng h\u00f3a: xu\u1ea5t nh\u1eadp kh\u1ea7u,"", ""confidence"": 0.9687554240226746, ""text_region"": [[181.0, 1459.0], [1099.0, 1456.0], [1099.0, 1489.0], [181.0, 1493.0]]}, {""text"": ""mua b\u00e1n v\u1eadt t\u01b0, ph\u1ee5 t\u00f9ng, thi\u1ebft b\u1ecb h\u00e0ng kh\u00f4ng: d\u1ecbch v\u1ee5 \u0111\u1ea1i l\u00fd cho c\u00e1c h\u00e3ng h\u00e0ng kh\u00f4ng,"", ""confidence"": 0.9722899794578552, ""text_region"": [[181.0, 1489.0], [1099.0, 1486.0], [1099.0, 1518.0], [181.0, 1521.0]]}, {""text"": ""c\u00e1c c\u00f4ng ty v\u1eadn t\u1ea3i, du l\u1ecbch, c\u00e1c nh\u00e0 s\u1ea3n xu\u1ea5t, cung \u01b0ng t\u00e0u bay, v\u1eadt t\u01b0 ph\u1ee5 t\u1eebng, thi\u1ebft"", ""confidence"": 0.9632856249809265, ""text_region"": [[183.0, 1519.0], [1103.0, 1516.0], [1103.0, 1549.0], [183.0, 1553.0]]}, {""text"": ""b\u1ecb t\u00e0u bay v\u00e0 trang thi\u1ebft b\u1ecb chuy\u00ean ng\u00e0nh h\u00e0ng kh\u00f4ng: cung \u1eefng d\u1ecbch v\u1ee5 th\u01b0\u01a1ng"", ""confidence"": 0.9499178528785706, ""text_region"": [[183.0, 1550.0], [1105.0, 1546.0], [1105.0, 1580.0], [183.0, 1583.0]]}], ""img_idx"": 7}"; 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