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

/
/
smg

Test String

Substitution

Processing...

Code Generator

Generated Code

#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox Local $sRegex = "(?sm)^(\d+\)\s*\d+\.\s+)(.*?) ISSN" Local $sString = "6) 6. ACROSS LANGUAGES AND CULTURES Semiannual ISSN: 1585-1923" & @CRLF & _ "AKADEMIAI KIADO ZRT, BUDAFOKI UT 187-189-A-3, BUDAPEST, HUNGARY, H-1117" & @CRLF & _ "Social Sciences Citation Index" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "7) 7. ACTA ANALYTICA-INTERNATIONAL PERIODICAL FOR PHILOSOPHY IN" & @CRLF & _ "THE ANALYTICAL TR ADITION" & @CRLF & _ "Quarterly ISSN: 0353-5150" & @CRLF & _ "SPRINGER, 233 SPRING ST, NEW YORK, USA, NY, 10013" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "8) 8. ACTA ARCHAEOLOGICA Annual ISSN: 0065-101X" & @CRLF & _ "WILEY, 111 RIVER ST, HOBOKEN, USA, NJ, 07030-5774" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "9) 9. ACTA BOREALIA Semiannual ISSN: 0800-3831" & @CRLF & _ "ROUTLEDGE JOURNALS, TAYLOR & FRANCIS LTD, 2-4 PARK SQUARE, MILTON PARK, ABINGDON, ENGLAND, OXON, OX14 4RN" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "10) 10. ACTA CLASSICA Annual ISSN: 0065-1141" & @CRLF & _ "UNIV FREE STATE, DEPT ENG CLASSICAL LANG, PO BOX 339, BLOEMFONTEIN, SOUTH AFRICA, 9300" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "11) 11. ACTA HISTORICA TALLINNENSIA Annual ISSN: 1406-2925" & @CRLF & _ "ESTONIAN ACADEMY PUBLISHERS, 6 KOHTU, TALLINN, ESTONIA, 10130" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "12) 12. ACTA HISTRIAE Tri-annual ISSN: 1318-0185" & @CRLF & _ "4" & @CRLF & _ "تاریخ انتشار: 89/2/62 پژوهشگاه و شبکه آزمایشگاهی 98/3 :Code UNIV PRIMORSKA, SCI RES CENTRE KOPER, GARIBALDIJEVA 1," & @CRLF & _ "KOPER, SLOVENIA, CAPODISTRIA, SI-6000" & @CRLF & _ "Social Sciences Citation Index" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "13) 13. ACTA KOREANA Semiannual ISSN: 1520-7412" & @CRLF & _ "ACADEMIA KOREANA KEIMYUNG UNIV, 1095 DALGUBEOLDAERO, DALSEO-GU, DAEGU, SOUTH KOREA, 704-701" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "Current Contents - Arts & Humanities" & @CRLF & _ "14) 14. ACTA LINGUISTICA HUNGARICA Quarterly ISSN: 1216-8076" & @CRLF & _ "AKADEMIAI KIADO ZRT, BUDAFOKI UT 187-189-A-3, BUDAPEST, HUNGARY, H-1117" & @CRLF & _ "Social Sciences Citation Index" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "15)15. ACTA LITERARIA Semiannual ISSN: 0717-6848" & @CRLF & _ "UNIV CONCEPCION, FAC HUMANIDADES ARTE, CASILLA 160-C, CORREO 3, CONCEPCION, CHILE, 00000" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "16) 16. ACTA MUSICOLOGICA Semiannual ISSN: 0001-6241" & @CRLF & _ "INT MUSICOLOGICAL SOC, BOX 561, BASEL, SWITZERLAND, CH-4001" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "Current Contents - Arts & Humanities" & @CRLF & _ "17) 17. ACTA ORIENTALIA ACADEMIAE SCIENTIARUM HUNGARICAE Quarterly ISSN: 1588-2667" & @CRLF & _ "AKADEMIAI KIADO ZRT, BUDAFOKI UT 187-189-A-3, BUDAPEST, HUNGARY, H-1117" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "5" & @CRLF & _ "تاریخ انتشار: 89/2/62 پژوهشگاه و شبکه آزمایشگاهی 98/3 :Code Current Contents - Arts & Humanities" & @CRLF & _ "18) 18. ACTA PHILOSOPHICA Semiannual ISSN: 1121-2179" & @CRLF & _ "FABRIZIO SERRA EDITORE, PO BOX NO,1, SUCC NO. 8, PISA, ITALY, I-56123" & @CRLF & _ "Arts & Humanities Citation Index" & @CRLF & _ "Current Contents - Arts & Humanities" Local $sSubst = "" Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst) MsgBox($MB_SYSTEMMODAL, "Result", $sResult)

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