Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • 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
No Match

@"
"
gm

Test String

Code Generator

Generated Code

using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"[\s\S]*?\[General\][\s\S]*?SystemMustBeRebooted=(\d)[\s\S]*?\[Install Execution\][\s\S]*?SilentInstall=""(HPUP.exe)"".*"; string input = @"[CVA File Information] CVATimeStamp=20241230T074049 CVASyntaxVersion=2.1A6 [Software Title] US=Realtek HD Audio Driver AR=Realtek HD Audio Driver BG=Realtek HD Audio Driver BR=Realtek HD Audio Driver CS=Realtek HD Audio Driver DA=Realtek HD Audio Driver DE=Realtek HD Audio Driver EL=Realtek HD Audio Driver ES=Realtek HD Audio Driver ET=Realtek HD Audio Driver FI=Realtek HD Audio Driver FR=Realtek HD Audio Driver HE=Realtek HD Audio Driver HK=Realtek HD Audio Driver HR=Realtek HD Audio Driver HU=Realtek HD Audio Driver IT=Realtek HD Audio Driver JA=Realtek HD Audio Driver KO=Realtek HD Audio Driver LT=Realtek HD Audio Driver LV=Realtek HD Audio Driver NL=Realtek HD Audio Driver NO=Realtek HD Audio Driver PL=Realtek HD Audio Driver PT=Realtek HD Audio Driver RO=Realtek HD Audio Driver RU=Realtek HD Audio Driver SK=Realtek HD Audio Driver SL=Realtek HD Audio Driver SR=Realtek HD Audio Driver SV=Realtek HD Audio Driver TH=Realtek HD Audio Driver TR=Realtek HD Audio Driver TW=Realtek HD Audio Driver ZH=Realtek HD Audio Driver [US.Software Description] This package contains the driver that enables the Realtek High-Definition (HD) Audio in supported notebook models that are running a supported operating system. [AR.Software Description] تحتوي هذه الحزمة على برنامج التشغيل اللازم لتمكين أجهزة صوت Realtek عالية الوضوح. [BG.Software Description] Този пакет включва драйвер за активиране на Realtek аудио хардуера с висока разделителна способ ност. [BR.Software Description] Este pacote inclui o driver que habilita o hardware de áudio de alta definição Realtek. [CS.Software Description] Toto balení obsahuje ovladač, který aktivuje zvukový hardware s vysokým rozliÅ¡ením. [DA.Software Description] Denne pakke indeholder driveren, som muliggør Realtek HD-lydhardware. [DE.Software Description] Dieses Paket enthält den Realtek-HD-Audio-Treiber. [EL.Software Description] Το πακέτο αυτό περιέχει το πρόγραμμα οδήγησης για την ενεργοποίηση του υλικού ήχου υψηλής ευ κρίνειας Realtek. [ES.Software Description] Este paquete incluye el controlador para habilitar el hardware de audio Realtek de alta definición. [ET.Software Description] Realtek kõrglahutusega heliriistvara lubamiseks sisaldab see pakett vastavat draiverit. [FI.Software Description] Tämä pakkaus sisältää ohjaimen, joka mahdollistaa äänilaitteen Realtek-teräväpiirtoäänen. [FR.Software Description] Cet emballage contient le pilote pour activer le matériel audio haute définition Realtek. [HE.Software Description] חבילה זו מכילה את מנהל ההתקן המאפשר חיבור והפעלה של התקני שמע Realtek באיכות עילית (HD). [HK.Software Description] 本套件包含用於啟用 Realtek 高傳真音訊硬體的驅動程式。 [HR.Software Description] Ovaj paket sadrži upravljački program koji omogućuje rad Realtek hardvera za zvuk visoke definicije. [HU.Software Description] Ez a csomag a nagy felbontású élményt nyújtó Realtek hangeszköz működtetéséhez szükséges illesztÅ‘programot tartalmazza. [IT.Software Description] Questo pacchetto contiene il driver che consente di attivare l’audio ad alta definizione Realtek. [JA.Software Description] このパッケージにはRealtek High-Definition Audioハードウェアを有効にするドライバーが含まれています。 [KO.Software Description] 본 패키지에는 Realtek 고화질 오디어 하드웨어를 활성화하는 드라이버가 있습니다. [LT.Software Description] Ä® šį paketÄ… įeina tvarkyklÄ—, skirta Realtek raiÅ¡kiojo garso aparatÅ«rai įjungti. [LV.Software Description] Å Ä« pakotne ietver draiveri, kas iespÄ“jo Realtek augstas izšķirtspÄ“jas audio aparatÅ«ru. [NL.Software Description] Dit pakket bevat de driver voor het activeren van Realtek high-definition audiohardware. [NO.Software Description] Denne pakken inkluderer driverer for Ã¥ aktivere Realtek HD-lydmaskinvare. [PL.Software Description] Niniejszy pakiet zawiera sterownik urzÄ…dzenia dźwiÄ™kowego Realtek high-definition. [PT.Software Description] Este pacote inclui o controlador para ativar hardware de áudio Realtek de alta definição. [RO.Software Description] Acest pachet include driverul pentru activarea echipamentului audio de înaltă definiÈ›ie (HD) Realtek. [RU.Software Description] Этот пакет содержит драйвер, который обеспечивает работу аудио Realtek для звукового оборудоваР½Ð¸Ñ высокой чёткости. [SK.Software Description] Tento balík zahŕňa ovládač na aktiváciu zvukového hardvéru Realtek s vysokým rozlíšením. [SL.Software Description] Paket vključuje gonilnik za omogočanje visokoločljivostne zvočne strojne opreme Realtek. [SR.Software Description] Ovaj paket obuhvata upravljački program koji će omogućiti Realtek audio hardver visoke definicije. [SV.Software Description] Detta paket innehÃ¥ller en drivrutin för aktivering av Realtek High-Definition Audio. [TH.Software Description] เพกเกจนี้รวมถึงไดรเวอร์ที่จะเปิดใช้งานฮาร์ดแวร์เสียงความภ„มชัด-สูง Realtek [TR.Software Description] Bu paket, Realtek yüksek tanımlı ses donanımını etkinleÅŸtirecek sürücüyü içermektedir. [TW.Software Description] 本套件包含用於啟用 Realtek 高傳真音訊硬體的驅動程式。 [ZH.Software Description] 该包装包含可启用 Realtek 高分辨率音频硬件的驱动程序。 [General] PN=P01759-B2M Version=24.9764.1433.30 Revision=Q Pass=5 Type=Driver Category=Driver-Audio SystemMustBeRebooted=0 VendorName=REALTEK VendorVersion=6.0.9764.1_30Q5 [SupportedLanguages] Languages=GLOBAL Countries=GBL [ProfessionalInnovations] HPPI=NO LearnMore= [DetailFileInformation] RTKVHD64.sys=<DRIVERS>\,0x0006,0x0000,0x2624,0x0001,WT64_22H2 RTKVHD64.sys=<DRIVERS>\,0x0006,0x0000,0x2624,0x0001,W11_22H2 RTKVHD64.sys=<DRIVERS>\,0x0006,0x0000,0x2624,0x0001,W11_23H2 RTKVHD64.sys=<DRIVERS>\,0x0006,0x0000,0x2624,0x0001,W11_24H2 [Softpaq] SoftpaqNumber=SP156235 SupersededSoftpaqNumber=SP154247 SoftPaqMD5=12AA316EC1625CAABB8FF56ACD5D1138 SoftPaqSHA256=AB4EBF5DCBEF5885786AE90A5B873B49418A8733366EF53489E806F7EE1C2919 SoftPaqSHA512=99261FFCD00E912D5449A5B2EC41229FB5FB02D69E0DF2D2878911877E98F6F66FB449600F356129B2386545F459A6CD5D5D3634D16D716C35BD1FF42184125B [Devices] PCI\VEN_8086&DEV_54C8=""Intel(R) Smart Sound Technology BUS"" PCI\VEN_8086&DEV_51CA=""Intel(R) Smart Sound Technology BUS"" PCI\VEN_8086&DEV_51C8=""Intel(R) Smart Sound Technology BUS"" PCI\VEN_1022&DEV_15E2=""AMD Audio CoProcessor"" PCI\VEN_8086&DEV_7A50=""Intel(R) Smart Sound Technology BUS"" PCI\VEN_8086&DEV_7E28=""Intel®? Smart Sound Technology BUS"" PCI\VEN_8086&DEV_7F50=""Intel®? Smart Sound Technology BUS"" [Devices_INFPath] WT64_22H2_INFPath=src\driver W11_22H2_INFPath=src\driver W11_23H2_INFPath=src\driver W11_24H2_INFPath=src\driver [System Information] SysId01=0x8CF5 SysName01=HP ZBOOK STUDIO 16 INCH G11 MOBILE SysId02=0x8C26 SysName02=HP ELITE X360 830 13 INCH G11,HP ELITEBOOK 830 13 INCH G11,HP ELITEBOOK 860 16 INCH G11,HP ELITEBOOK 840 14 INCH G11 SysId03=0x8C85 SysName03=HP ELITEBOOK 630 13.3 INCH G11 SysId04=0x8CA0 SysName04=HP ZBOOK POWER 16 INCH G11 MOBILE SysId05=0x8C52 SysName05=HP ELITE X360 1040 14 INCH G11,HP ELITEBOOK 1040 14 INCH G11 SysId06=0x8C83 SysName06=HP PROBOOK 440 14 INCH G11 SysId07=0x8C86 SysName07=HP ELITEBOOK 640 14 INCH G11 SysId08=0x8CD1 SysName08=HP ZBOOK FIREFLY 14 INCH G11 MOBILE,HP ZBOOK FIREFLY 16 INCH G11 MOBILE SysId09=0x8C87 SysName09=HP ELITEBOOK 660 16 INCH G11 SysId10=0x8C84 SysName10=HP PROBOOK 460 16 INCH G11 [Operating Systems] WT64_22H2=OEM W11_22H2=OEM W11_23H2=OEM W11_24H2=OEM [US.Enhancements] - Increase microphone default values of volume and boost. - Includes the following drivers: Cirrus Logic Awesome Speaker Amps Driver, version 21.51.46.157 Fortemedia Audio Effects Component Driver, version 12.1.6003.6017 Intel Smart Sound Technology BUS Driver, version 20.40.11433.4 Intel Smart Sound Technology OED Driver, version 20.40.11433.4 Realtek Audio Driver, version 6.0.9764.1 [Install Execution] Install=""HPUP.exe"" SilentInstall=""HPUP.exe"" [ReturnCode] 1024:SUCCESS:REBOOT=A restart is required to complete the install. This message is indicative of a success 400:SUCCESS:REBOOT=A restart is required to complete the install. This message is indicative of a success 0:SUCCESS:NOREBOOT=The action completed successfully [Private] Private_SSMCompliant=1 HardwareSupportApp_Compliant=0 DPB_Compliant=1 MS_Store_App=0 DriverType=Universal Private_ReleaseType=Routine Private_ProductType = Notebooks [Private_Fixes] - Fixes an issue where noise suppression does not function properly during a VoIP call. - Fixes an issue where the Fortemedia Audio driver causes memory leaks to occur. - Fixes an issue where the hotkey mic mute button does not sync with certain Bluetooth headphones. [Private_SoftpaqInstall] 1. Download the file by clicking the Download or Obtain Software button and saving the file to a folder on your hard drive (make a note of the folder where the downloaded file is saved). 2. Double-click the downloaded file and follow the on-screen instructions. [CVAToolDocumentStamp] Generated by Release CVA Tool Version 1.0 using Syntax Version 2.0 A1 on 12/30/2024 7:40:49 AM Copyright (c) 2024 HP Development Company, L.P."; 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