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 single character of: a, b, c or d
    [[ab][cd]]
  • 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]
  • Character class intersection
    [\w&&[^\d]]
  • 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)^([a-zA-ZáéíóúàèìòùÁÉÍÓÚÀÈÌÒÙ]+ )*+[a-zA-ZáéíóúàèìòùÁÉÍÓÚÀÈÌÒÙ]+$" Local $sString = "Aarón Ander" & @CRLF & _ "Abel Andrés Joel" & @CRLF & _ "Abelardo Ángel Jon" & @CRLF & _ "Abraham Aníbal Jordi" & @CRLF & _ "Adalberto Antonio Jorge" & @CRLF & _ "Adam Arnau José" & @CRLF & _ "Adán Arturo Jose Antonio" & @CRLF & _ "Adiran Asier Jose Luis" & @CRLF & _ "Adolfo Augusto Jose Manuel" & @CRLF & _ "Adrià Aurelio Jose Maria" & @CRLF & _ "Adrián Baltasar Juan" & @CRLF & _ "Agustín Bartolomé Blas" & @CRLF & _ "Aimar Basilio Juan Antonio" & @CRLF & _ "Aitor Benito Boris" & @CRLF & _ "Alano Benjamín Juan Carlos" & @CRLF & _ "Alberto Bernardo Borja" & @CRLF & _ "Aldo Bienvenido Brahim" & @CRLF & _ "Aleix Blas Brais" & @CRLF & _ "Alejandro Boris Bruno" & @CRLF & _ "Alejo Borja Calisto" & @CRLF & _ "Alex Brahim Juan José" & @CRLF & _ "Alfonso Brais Camilo" & @CRLF & _ "Alfredo Bruno Juan Manuel" & @CRLF & _ "Alonso Calisto Carlos" & @CRLF & _ "Álvaro Camilo Julio" & @CRLF & _ "Amadeo Carlos Cayetano" & @CRLF & _ "Amado Cayetano César" & @CRLF & _ "Amando César Christian" & @CRLF & _ "Ambrosio Christian Claudio" & @CRLF & _ "Amin Claudio Clemente" & @CRLF & _ "Anastasio Clemente Conrado" & @CRLF & _ "Ander Conrado Constantino" & @CRLF & _ "Constantino Francisco Javier Joel" & @CRLF & _ "Crispín Francisco José Jon" & @CRLF & _ "Cristian Gabriel Jordi" & @CRLF & _ "Daniel Gaspar Jorge" & @CRLF & _ "Darío Gerard José" & @CRLF & _ "David Gerardo Jose Antonio" & @CRLF & _ "Desiderio Germán Jose Luis" & @CRLF & _ "Diego Gonzalo Jose Manuel" & @CRLF & _ "Dionisio Gregorio Jose Maria" & @CRLF & _ "Domingo Guillem Juan" & @CRLF & _ "Donato Guillermo Juan Antonio" & @CRLF & _ "Edgar Gustavo Juan Carlos" & @CRLF & _ "Edmundo Hamza Juan José" & @CRLF & _ "Eduardo Héctor Juan Manuel" & @CRLF & _ "Elías Honorato Julio" & @CRLF & _ "Eloy Hugo Justino" & @CRLF & _ "Emilio Humberto Justo" & @CRLF & _ "Eneko Ibai Kevin" & @CRLF & _ "Enrique Ibrahim Kilian" & @CRLF & _ "Eric Ignacio Leo" & @CRLF & _ "Ernesto Iker Leopoldo" & @CRLF & _ "Esteban Isidoro Lorenzo" & @CRLF & _ "Eugenio Ismael Louis" & @CRLF & _ "Eusebio Ivo Lucas" & @CRLF & _ "Fabián Izan Luciano" & @CRLF & _ "Federico Jaime Luis" & @CRLF & _ "Felipe Jan Macario" & @CRLF & _ "Félix Jaume Manuel" & @CRLF & _ "Fermín Javier Marc" & @CRLF & _ "Fernando Jesús Marcelo" & @CRLF & _ "Fidel Joan Marco" & @CRLF & _ "Francisco Joaquín Marcos" & @CRLF & _ "Marcos Pau Tomás" & @CRLF & _ "Mariano Pedro Ulises" & @CRLF & _ "Mario Pelayo Unai" & @CRLF & _ "Marti Plácido Urbano" & @CRLF & _ "Martín Platón Valentín" & @CRLF & _ "Mateo Pol Vicente" & @CRLF & _ "Matías Ponce Víctor" & @CRLF & _ "Mauricio Quintín Virgilio" & @CRLF & _ "Maximiliano Rafael Walter" & @CRLF & _ "Máximo Ramiro Wen" & @CRLF & _ "Miguel Ramón Xabier" & @CRLF & _ "Miguel Ángel Raúl Xavier" & @CRLF & _ "Mikel Ricardo Ximen" & @CRLF & _ "Mohamed Roberto Yerai" & @CRLF & _ "Moisés Rodrigo Yeray" & @CRLF & _ "Nabil Rogelio Yunes" & @CRLF & _ "Narciso Román Yusef" & @CRLF & _ "Nathan Rubén Zacarías" & @CRLF & _ "Nicolás Salvador Zenon" & @CRLF & _ "Noé Samuel Zoilo" & @CRLF & _ "Octavio Santiago" & @CRLF & _ "Oier Sebastián" & @CRLF & _ "Omar Sergi" & @CRLF & _ "Oriol Sergio" & @CRLF & _ "Óscar Silvestre" & @CRLF & _ "Pablo Simón" & @CRLF & _ "Pancho Teodoro" 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