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

/
/
gm

Test String

Code Generator

Generated Code

#include <StringConstants.au3> ; to declare the Constants of StringRegExp #include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate Local $sRegex = "(?m)\$(?P<ID>[\w\d-]+).(.|\n)(?P<Title>.+)..(?P<URL>https:\/\/[\w\-\.\/]+)..(?P<DESC>[^\(]*)" Local $sString = ";ö¯?»" & @CRLF & _ "$1cb07348-34a4-4741-b50f-c41e584370f7TeamSpeak Addon AuthorVhttps://badges-content.teamspeak.com/1cb07348-34a4-4741-b50f-c41e584370f7/addon_author"Creator of TeamSpeak Addons(??0·" & @CRLF & _ "$50bbdbc8-0f2a-46eb-9808-602225b49627" & @CRLF & _ "Gamescom 2016Whttps://badges-content.teamspeak.com/50bbdbc8-0f2a-46eb-9808-602225b49627/gamescom_2016"Registered during Gamescom 2016(??0?" & @CRLF & _ "$d95f9901-c42d-4bac-8849-7164fd9e2310Paris Games Week 2016^https://badges-content.teamspeak.com/d95f9901-c42d-4bac-8849-7164fd9e2310/paris_gamesweek_2016"'Registered during Paris Games Week 2016(??0³" & @CRLF & _ "$62444179-0d99-42ba-a45c-c6b1557d079a" & @CRLF & _ "Gamescom 2014Whttps://badges-content.teamspeak.com/62444179-0d99-42ba-a45c-c6b1557d079a/gamescom_2014"Registered at Gamescom 2014(??0?" & @CRLF & _ "$fa3ece28-64df-431f-b1b3-90844bfdd2d9Paris Games Week 2014^https://badges-content.teamspeak.com/fa3ece28-64df-431f-b1b3-90844bfdd2d9/paris_gamesweek_2014"#Registered at Paris Games Week 2014(??0?" & @CRLF & _ "$450f81c1-ab41-4211-a338-222fa94ed157"TeamSpeak Addon Developer (Bronze)]https://badges-content.teamspeak.com/450f81c1-ab41-4211-a338-222fa94ed157/addon_author_bronze"%Creator of at least 1 TeamSpeak Addon(?­???" & @CRLF & _ "$c9e97536-5a2d-4c8e-a135-af404587a472"TeamSpeak Addon Developer (Silver)]https://badges-content.teamspeak.com/c9e97536-5a2d-4c8e-a135-af404587a472/addon_author_silver"&Creator of at least 3 TeamSpeak Addons(?­???" & @CRLF & _ "$94ec66de-5940-4e38-b002-970df0cf6c94 TeamSpeak Addon Developer (Gold)[https://badges-content.teamspeak.com/94ec66de-5940-4e38-b002-970df0cf6c94/addon_author_gold"&Creator of at least 5 TeamSpeak Addons(?­??º" & @CRLF & _ "$534c9582-ab02-4267-aec6-2d94361daa2a" & @CRLF & _ "Gamescom 2017Whttps://badges-content.teamspeak.com/534c9582-ab02-4267-aec6-2d94361daa2a/gamescom_2017""Visited TeamSpeak at Gamescom 2017(;µ¯0µ" & @CRLF & _ "$34dbfa8f-bd27-494c-aa08-a312fc0bb240Gamescom Hero 2017Shttps://badges-content.teamspeak.com/34dbfa8f-bd27-494c-aa08-a312fc0bb240/hero_2017"Gaming Hero at Gamescom 2017(;µ¯0¦" & @CRLF & _ "$7d9fa2b1-b6fa-47ad-9838-c239a4ddd116MIFCOMPhttps://badges-content.teamspeak.com/7d9fa2b1-b6fa-47ad-9838-c239a4ddd116/mifcom"MIFCOM | Entered Performance(;µ¯0¨" & @CRLF & _ "$f81ad44d-e931-47d1-a3ef-5fd160217cf8 4NetplayersUhttps://badges-content.teamspeak.com/f81ad44d-e931-47d1-a3ef-5fd160217cf8/4netplayers"4Netplayers customer(??0ª" & @CRLF & _ "$f22c22f1-8e2d-4d99-8de9-f352dc26ac5bRocket Beans TVNhttps://badges-content.teamspeak.com/f22c22f1-8e2d-4d99-8de9-f352dc26ac5b/rbtv"Rocket Beans TV Community(???0ª" & @CRLF & _ "$64221fd1-706c-4bb2-ba55-996c39effa79TeamSpeak JediOhttps://badges-content.teamspeak.com/64221fd1-706c-4bb2-ba55-996c39effa79/TS-OG"myTeamSpeak early adopter(¼?ù?0³" & @CRLF & _ "$c3f823eb-5d5c-40f9-9dbd-3437d59a539dOfficial TeamSpeak GamerQhttps://badges-content.teamspeak.com/c3f823eb-5d5c-40f9-9dbd-3437d59a539d/TS-2018"New myTeamSpeak member(¼?ù?0ª" & @CRLF & _ "$935e5a2a-954a-44ca-aa7a-55c79285b601E3 2018 - WinnerQhttps://badges-content.teamspeak.com/935e5a2a-954a-44ca-aa7a-55c79285b601/E3-2018"Discovered at E3 2018(??0º" & @CRLF & _ "$4eef1ecf-a0ea-423d-bfd0-496543a00305" & @CRLF & _ "Gamescom 2018Whttps://badges-content.teamspeak.com/4eef1ecf-a0ea-423d-bfd0-496543a00305/gamescom_2018""Visited TeamSpeak at Gamescom 2018(û¡¶?0?" & @CRLF & _ "$24512806-f886-4440-b579-9e26e4219ef6Gamescom Hero 2018^https://badges-content.teamspeak.com/24512806-f886-4440-b579-9e26e4219ef6/gamescom_2018_played"#Gamescom Exclusive Gaming Hero 2018(û¡¶?0´" & @CRLF & _ "$b9c7d6ad-5b99-40fb-988c-1d02ab6cc130Found Tim SpeakQhttps://badges-content.teamspeak.com/b9c7d6ad-5b99-40fb-988c-1d02ab6cc130/met_tim" Found Tim Speak at Gamescom 2018(û¡¶?0½" & @CRLF & _ "$6b187e83-873b-46b0-b2c2-a31af15e76a4TeamSpeak Merch BadgeQhttps://badges-content.teamspeak.com/6b187e83-873b-46b0-b2c2-a31af15e76a4/cap_red"#TeamSpeak Merch Owner - 1st Edition(?û?0´" & @CRLF & _ "$4b0fd4f5-d456-4294-973d-853a1db5c7d8Valentim's Day 2019Zhttps://badges-content.teamspeak.com/4b0fd4f5-d456-4294-973d-853a1db5c7d8/Valentines_Badge"Valentim's Day 2019(??0?" & @CRLF & _ "$9cd152a7-bf65-4ece-aeba-62d27678f79a"TeamSpeak Competition Winner BadgeYhttps://badges-content.teamspeak.com/9cd152a7-bf65-4ece-aeba-62d27678f79a/CompWinnerBadge"TeamSpeak Competition Winner(??À" & @CRLF & _ "$22b9ec39-7694-453e-864c-dfc7b1b0d7c7TeamSpeak Merch Badge 2.0Phttps://badges-content.teamspeak.com/22b9ec39-7694-453e-864c-dfc7b1b0d7c7/topper"#TeamSpeak Merch Owner - 2nd Edition(¡???" & @CRLF & _ "$904e232c-f369-44db-87f7-5142e15620cc Time MachineVhttps://badges-content.teamspeak.com/904e232c-f369-44db-87f7-5142e15620cc/time_machine";Worked like a machine to update addons in super-quick time.(???" & @CRLF & _ "$87ccf9ea-67c9-45e5-adbc-77e210e6128aMet TimQhttps://badges-content.teamspeak.com/87ccf9ea-67c9-45e5-adbc-77e210e6128a/tim_irl"Met Tim Speak IRL(?ý??" & @CRLF & _ "$c2368518-3728-4260-bcd1-8b85e9f8984cTestQhttps://badges-content.teamspeak.com/c2368518-3728-4260-bcd1-8b85e9f8984c/Testing"Testing, Testing.(?©?²" & @CRLF & _ "$ef567ec5-f46e-4520-be07-6021023cf6bdSponsorship LicenseUhttps://badges-content.teamspeak.com/ef567ec5-f46e-4520-be07-6021023cf6bd/Sponsorship"Sponsored by TeamSpeak(??·" & @CRLF & _ "$b82a45a5-b235-4926-be77-de102222e5eb" & @CRLF & _ "Gamescom 2019Thttps://badges-content.teamspeak.com/b82a45a5-b235-4926-be77-de102222e5eb/Gamescom19""Visited TeamSpeak at Gamescom 2019(¡²?0«" & @CRLF & _ "$4086a249-a503-4f31-9e83-8a0a8e3089bdTim-o'-LanternWhttps://badges-content.teamspeak.com/4086a249-a503-4f31-9e83-8a0a8e3089bd/Tim-O-Lantern"Mwuhaahaahaahaahaa(???" & @CRLF & _ "$de7bd960-eb02-47e1-9ce2-a44f6e255d8fHappy Holidays 2019Xhttps://badges-content.teamspeak.com/de7bd960-eb02-47e1-9ce2-a44f6e255d8f/Happy_Holidays"*Happy holidays from everyone at TeamSpeak!(´??0¥" & @CRLF & _ "$d6062d9c-42a3-49c9-91dd-8c43a5a46805 Bug CatcherXhttps://badges-content.teamspeak.com/d6062d9c-42a3-49c9-91dd-8c43a5a46805/BugBadge_Splat"I found a bug!(??0¾" & @CRLF & _ "$cbf5aafd-2554-4053-80bb-0cf82ec0a430 Bright Idea`https://badges-content.teamspeak.com/cbf5aafd-2554-4053-80bb-0cf82ec0a430/FeatureBadge_Lightbulb"TeamSpeak took my idea on board(??0?" & @CRLF & _ "$ed85bdff-2a2b-4bea-a1a5-4d06fcc0d776Merry Christmas 2019Shttps://badges-content.teamspeak.com/ed85bdff-2a2b-4bea-a1a5-4d06fcc0d776/Christmas"/It’s the most wonderful ‘Tim’ of the Year(?¤?0°" & @CRLF & _ "$92801833-e721-4b7e-84d4-6c02dbb332b9Valentim's Day 2020Vhttps://badges-content.teamspeak.com/92801833-e721-4b7e-84d4-6c02dbb332b9/Valentim2020"Valentim's Day 2020(??0" & @CRLF & _ "$205916f3-a953-4754-8905-bc15069b1f91TeamSpeak Merch Badge 3.0Phttps://badges-content.teamspeak.com/205916f3-a953-4754-8905-bc15069b1f91/Merch3"%TeamSpeak Merch Owner — 3rd Edition(??0´" & @CRLF & _ "$8dfa37ac-b40d-4466-b393-ff2184a9adf3Overwatch LeagueShttps://badges-content.teamspeak.com/8dfa37ac-b40d-4466-b393-ff2184a9adf3/OWL_Badge"I follow the Overwatch League(ÿ???" & @CRLF & _ "$7a627d47-5496-4d68-83b5-2c4eafff9b30Stay Home, Stay SafeZhttps://badges-content.teamspeak.com/7a627d47-5496-4d68-83b5-2c4eafff9b30/StaySafeStayHome" Playing Apart, Staying Connected(ÿ?·??À" & @CRLF & _ "$1aa375e8-7207-45bf-8b80-556bafafc834 Reality EggVhttps://badges-content.teamspeak.com/1aa375e8-7207-45bf-8b80-556bafafc834/E_RealityEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??¼" & @CRLF & _ "$5f6d49e4-35c8-4809-8c81-6e71f7f749e9 Power EggThttps://badges-content.teamspeak.com/5f6d49e4-35c8-4809-8c81-6e71f7f749e9/E_PowerEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??¼" & @CRLF & _ "$641a4d85-2351-482c-97a1-02fc3b6abbb5 Space EggThttps://badges-content.teamspeak.com/641a4d85-2351-482c-97a1-02fc3b6abbb5/E_SpaceEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??º" & @CRLF & _ "$2c9698c1-1fec-4baa-a28f-4845f045f42fSoul EggShttps://badges-content.teamspeak.com/2c9698c1-1fec-4baa-a28f-4845f045f42f/E_SoulEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??º" & @CRLF & _ "$089c7295-3aa2-48b0-b2f1-2dd1bec12cafTime EggShttps://badges-content.teamspeak.com/089c7295-3aa2-48b0-b2f1-2dd1bec12caf/E_TimeEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??º" & @CRLF & _ "$0d98391c-ecdf-4f26-931a-49bfd669cda7Mind EggShttps://badges-content.teamspeak.com/0d98391c-ecdf-4f26-931a-49bfd669cda7/E_MindEgg"+Found in the TeamSpeak 2020 Easter Egg Hunt(?·¼??À" & @CRLF & _ "$56df5ce2-6c5a-4a24-90e2-29e497e26170Drone Champions LeagueShttps://badges-content.teamspeak.com/56df5ce2-6c5a-4a24-90e2-29e497e26170/DCL_Badge"#I follow the Drone Champions League(?ú0¶" & @CRLF & _ "$2bf80270-8efe-46dc-a472-3280a0479145 Alpha TesterOhttps://badges-content.teamspeak.com/2bf80270-8efe-46dc-a472-3280a0479145/Alpha"'Helped to test our software. THANK YOU!(?¶û0?" & @CRLF & _ "$dfc70674-0fd0-431e-b3a1-edc32d7b09b2Challenge AcceptedOhttps://badges-content.teamspeak.com/dfc70674-0fd0-431e-b3a1-edc32d7b09b2/scill"<Unlocked at SCILL Play — Challenges, tournaments and more!(À¢»ü0¥" & @CRLF & _ "$be932556-dfa9-4dc6-afd0-98de0ab25777 PolTeamgeistVhttps://badges-content.teamspeak.com/be932556-dfa9-4dc6-afd0-98de0ab25777/PolTeamgeist"WooOOHoohOOHooo(£?Áü0¦" & @CRLF & _ "$f85f7e21-753a-4566-b26a-4e3e9155d2ef CyberpunkShttps://badges-content.teamspeak.com/f85f7e21-753a-4566-b26a-4e3e9155d2ef/Cyberpunk"We have a city to burn(·µ¾0¥" & @CRLF & _ "$1a518885-520c-4f54-9f49-8b1acb674771" & @CRLF & _ "BraindanceThttps://badges-content.teamspeak.com/1a518885-520c-4f54-9f49-8b1acb674771/Braindance"I’m chippin’ in(·µ¾0L" & @CRLF & _ "$c6480fe2-ee25-4ee8-9853-243652c8ec54Merry Christmas 2020Whttps://badges-content.teamspeak.com/c6480fe2-ee25-4ee8-9853-243652c8ec54/Christmas2020"&Let it snow, let it snow, let it snow!(ª?0´" & @CRLF & _ "$d4ea0251-ba46-4c1a-83b7-59db3f89e52cHappy New Year 2021Whttps://badges-content.teamspeak.com/d4ea0251-ba46-4c1a-83b7-59db3f89e52c/firework_2020".Survived the great toilet paper crisis of 2020(?ÿ0?$8c22fe26-30ac-4231-8b31-67d8a75c808aYear of the Ox 2021Nhttps://badges-content.teamspeak.com/8c22fe26-30ac-4231-8b31-67d8a75c808a/ox21"MOnly listen to the fortune cookie; disregard all other fortune telling units.(?0?" & @CRLF & _ "" & @CRLF & _ "$05114019-6b46-4b13-b5a1-e5179ef69fb5 April Fools!Mhttps://badges-content.teamspeak.com/05114019-6b46-4b13-b5a1-e5179ef69fb5/rpg"LRoses are red, gaming is fun, you are carrying too much to be able to run :((»??0¬" & @CRLF & _ "$ceee2445-4fbf-4f06-9421-286f0f4e875aPrideOhttps://badges-content.teamspeak.com/ceee2445-4fbf-4f06-9421-286f0f4e875a/pride"$Never be afraid to show your colors.(??0®" & @CRLF & _ "$0005232e-538e-4cb2-93b6-d7d83e873829 PietSmietShttps://badges-content.teamspeak.com/0005232e-538e-4cb2-93b6-d7d83e873829/PietSmiet"Werde Snob auf PietSmiet.de ;)(¾??0·" & @CRLF & _ "$4b27be5a-b92a-4b30-8b2d-14b59653f42720th AnniversaryRhttps://badges-content.teamspeak.com/4b27be5a-b92a-4b30-8b2d-14b59653f427/20_years"!Celebrating 20 Years of TeamSpeak(ö¯?0" Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH) Local $aFullArray[0] For $i = 0 To UBound($aArray) -1 _ArrayConcatenate($aFullArray, $aArray[$i]) Next $aArray = $aFullArray ; Present the entire match result _ArrayDisplay($aArray, "Result")

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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm