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

#include <StringConstants.au3> ; to declare the Constants of StringRegExp #include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate Local $sRegex = "(?m)\-\s([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]*)|([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z.]{3,})\/" Local $sString = "24.06.2022 - Статьи на внешку - 6 - Челомова - vitok.ua.docx - Google Docs" & @CRLF & _ "https://real-vin.com/ispravlenie-prikusa-u-detej-plastinami-osobennosti" & @CRLF & _ "https://md-eksperiment.org/ru/post/20181030-protezirovanie-zubov-estetika-vidy-harakteristiki" & @CRLF & _ "https://md-eksperiment.org/ru/post/20181030-protezirovanie-zubov-estetika-vidy-harakteristiki" & @CRLF & _ "http://strichka.com/article/121746444" & @CRLF & _ "https://video.news.rin.ru/news_text/201741/" & @CRLF & _ "https://video.news.rin.ru/news/201741/" & @CRLF & _ "https://chdtu.edu.ua/ndi-chdtu/conferences-chdtu" & @CRLF & _ "https://strichka.com/article/121458075" & @CRLF & _ "https://obcity.gov.ua/2022/06/01/vseukrainska-stipendialna-programa-skyclinic-scholarship/" & @CRLF & _ "https://cikavosti.com/vazhn-e-prychyn-ne-terpet-bol-a-posetyt-stomatoloha-v-kyeve/" & @CRLF & _ "https://www.zaholovok.com.ua/u-chomu-plyusi-ta-osoblivosti-implantativ-straumann" & @CRLF & _ "https://zaholovok.com.ua/u-chomu-plyusi-ta-osoblivosti-implantativ-straumann" & @CRLF & _ "https://svaliava.rayon.in.ua/news/513952-tri-osnovni-sposobi-vipravlennya-prikusu-u-ditey" & @CRLF & _ "https://uzhgorod.net.ua/news/167547" & @CRLF & _ "https://www.uzhgorod.net.ua/news/167547" & @CRLF & _ "https://www.healthinfo.ua/articles/zdorovaia_gigiena/57875" & @CRLF & _ "https://kriptohit.ru/articles/chto-delat-esli-proglotil-breket.html" & @CRLF & _ "https://protocol.ua/ua/pochemu-otbelivanie-zubov-nado-provodit-u-stomatologa-kieve/" & @CRLF & _ "https://nuft.edu.ua/studentu/vazhliva-nformaczya/konkurs-za-inicziativi-naczionalnogo-memorialnogo-kompleksu" & @CRLF & _ "https://nuft.edu.ua/studentu/vazhliva-nformaczya/konkurs-za-inicziativi-naczionalnogo-memorialnogo-kompleksu" & @CRLF & _ "https://zhzh.info/news/2014-09-19-20583" & @CRLF & _ "https://www.poznavayka.org/anatomiya-i-meditsina/plyusy-i-minusy-ligaturnyh-breketov-stoit-li-ustanavlivat/" & @CRLF & _ "https://protocol.ua/ru/pochemu-otbelivanie-zubov-nado-provodit-u-stomatologa-kieve/" & @CRLF & _ "https://vz.ua/news/76398-bezopasna-li-odnomomentnaya-implantaciya-zubov" & @CRLF & _ "https://rusjev.net/2022/04/19/chto-takoe-otbelivanie-beyond/" & @CRLF & _ "https://shipovnik.ua/novosti/89279" & @CRLF & _ "https://eukraina.com/news/osobennosti_nesemnykh_zubnykh_protezov_kak_vybrat_podkhodjashhie/2022-02-19-26517" & @CRLF & _ "http://rusjev.net/2022/04/19/chto-takoe-otbelivanie-beyond/" & @CRLF & _ "https://healthinfo.ua/articles/zdorovaia_gigiena/57875" & @CRLF & _ "https://kharkovblog.info/pnews/implantaty-megagen-v-chem-osobennosti-i-preimushestva/" & @CRLF & _ "https://glavnoe.ua/news/n357084592-skolko-dlitsya-odnomomentnaya-implantaciya-zuba" & @CRLF & _ "https://onmedu.edu.ua/zaproshuiemo-prijnjati-uchast-u-scholarship-socialnij-programi-dlja-studentiv-ta-abituriientiv/" & @CRLF & _ "https://gorod.dp.ua/news/158085" 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