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

/
/
g

Test String

Code Generator

Generated Code

package main import ( "regexp" "fmt" ) func main() { var re = regexp.MustCompile(`(?<=kili[+])([0-9,a-z:]*)`) var str = `[19608:16328:1102/113918.888:INFO:CONSOLE(70)] "[object Object]", source: chrome-extension://mnlhjepbejgption.js (70) [19608:16328:1102/113918.974:INFO:CONSOLE(70)] "3ce9326dbf418abd3e7b6c2053fb33f3f932c0d24464b255e465174e2ba4227e4d28c2ad438b8a8e1d493aac5409c160", source: chrome-extension://mknljjcgepbejgnpkhjjobco/content_kepion.js (70) [19608:16328:1102/113918.974:INFO:CONSOLE(70)] "Output", source: chrome-extension://mknljjcgnciabejgnpkhjjobco/contption.js (70) [19608:16328:1102/113918.974:INFO:CONSOLE(70)] "df1270d17e4d9b7e5850cf", source: chrome-extension:jepbejgpjjobco/content_kion.js (70) [19608:16328:1102/113918.992:INFO:CONSOLE(172)] "kili+14a3f1a9a023373f886ca2ff1f66294c:ac76bc99a93f5d849796e001208dd920", source: https://www.rndors-2a5le.js (172) [19608:16328:1102/113919.520:INFO:CONSOLE(172)] "KeyStatusesChangeEvent", source: https://www.rtdors-2a5ndle.js (172) [19608:16328:1102/113919.520:INFO:CONSOLE(172)] "[object Event]", source: https://www.tlvend0edle.js (172) [19608:16328:1102/113919.520:INFO:CONSOLE(172)] "null", source: https://www.rtvendors-2ade52.bunde.js (172) [19608:16328:1102/113919.520:INFO:CONSOLE(172)] "usable", source: https://www.rmhndors-2a5e52.budle.js (172)` for i, match := range re.FindAllString(str, -1) { fmt.Println(match, "found at index", i) } }

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 Golang, please visit: https://golang.org/pkg/regexp/