Regular Expressions 101

Save & Share

  • Regex Version: ver. 245
  • 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

r'
'
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)(?<=(?:"[^"]*?"\s*,\s*)|"question":\s*\[\s*))"([^"]*)"" Local $sString = "[" & @CRLF & _ " {" & @CRLF & _ " "questionsList": [" & @CRLF & _ " "정밀 동맥경화 협착도 검사(Segment ABI+TBI+PWV)는 어떤 환자에게 진행되나요?"," & @CRLF & _ " "정밀 동맥경화 협착도 검사(Segment ABI+TBI+PWV) 시 약이나 식사는 어떻게 해야 하나요?"," & @CRLF & _ " "정밀 동맥경화 협착도 검사(Segment ABI+TBI+PWV)는 어디에서 진행되나요?"," & @CRLF & _ " "안저촬영(Fundus photography, both)은 어떤 상태를 검사하는 기본 정밀검사인가요?"," & @CRLF & _ " "안저촬영(Fundus photography, both)으로 알 수 있는 질환은 무엇인가요?"," & @CRLF & _ " "안저촬영(Fundus photography, both)은 어디에서 진행되나요?"," & @CRLF & _ " "자율신경계 이상 검사(HRV) 전에 자제해야 하는 것은 무엇인가요?"," & @CRLF & _ " "자율신경계 이상 검사(HRV)는 어디에서 진행되나요?"," & @CRLF & _ " "말초신경병증 검사는 어떤 질병에 의한 신경 손상 정도를 알아보는 검사인가요?"," & @CRLF & _ " "말초신경병증 검사는 어디에서 진행되나요?"," & @CRLF & _ " "갑상선 세침흡입검사 전에 해야 할 일은 무엇인가요?"," & @CRLF & _ " "갑상선 세침흡입검사의 성공 가능성은 어느 정도인가요?"," & @CRLF & _ " "갑상선 세침흡입검사 시 어떤 옷을 입지 않도록 교육해야 하나요?"," & @CRLF & _ " "갑상선 세침흡입검사는 어디에서 진행되나요?"," & @CRLF & _ " "갑상선 초음파 검사 시 환자에게 어떤 설명을 해야 하나요?"," & @CRLF & _ " "갑상선 초음파 검사 시 어떤 옷을 입지 않도록 교육해야 하나요?"," & @CRLF & _ " "갑상선 초음파 검사는 어디에서 진행되나요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치)는 무엇을 측정하는 장치인가요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치)의 적응증은 무엇인가요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치)의 장점은 무엇인가요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치)의 단점은 무엇인가요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치) 사용 시 동의서가 필요한가요?"," & @CRLF & _ " "CGMS (Continuous glucose monitoring, 연속혈당측정장치) 사용 시 주의사항은 무엇인가요?"," & @CRLF & _ " "덱스콤 G7의 센서 사용 기간은 얼마인가요?"," & @CRLF & _ " "덱스콤 G7의 센서는 어디에 부착하나요?"," & @CRLF & _ " "덱스콤 G7 사용 시 본인 소유 스마트폰이 없을 경우 어떻게 해야 하나요?"," & @CRLF & _ " "덱스콤 G7 사용 시 와이파이를 끊으면 안되나요?"," & @CRLF & _ " "ipro-retro(레트로) 센서의 사용 시간은 얼마인가요?"," & @CRLF & _ " "ipro-retro(레트로) 사용 시 혈당 기록은 어떻게 해야 하나요?"," & @CRLF & _ " "ipro-retro(레트로) 센서 제거는 어디에서 해야 하나요?"," & @CRLF & _ " "리브레 센서의 사용 기간은 얼마인가요?"," & @CRLF & _ " "리브레 센서는 어디에 부착하나요?"," & @CRLF & _ " "리브레 앱으로 혈당 확인 시 무엇을 확인할 수 있나요?"," & @CRLF & _ " "리브레 센서 제거 후 어떻게 처리해야 하나요?"," & @CRLF & _ " "리브레 센서 부착된 팔에 혈압 측정이 금기인가요?"" & @CRLF & _ " ]" & @CRLF & _ " }" & @CRLF & _ "]" 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