Save & Share

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 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

Substitution
Processing...

Code Generator

Generated Code

package main import ( "regexp" "fmt" ) func main() { var re = regexp.MustCompile(`(?U)(.+):.+\(.+\),`) var str = `fakeroot:amd64 (1.20.2-1, automatic), libisl10:amd64 (0.12.2-2, automatic), libasan0:amd64 (4.8.4-1, automatic), libasan1:amd64 (4.9.2-10, au tomatic), libquadmath0:amd64 (4.9.2-10, automatic), libmpc3:amd64 (1.0.2-1, automatic), make:amd64 (4.0-8.1, automatic), libfile-fcntllock-perl:amd64 (0.22-1+b1, automatic), linux-kbuild-3.16:amd64 (3.16-3, automatic), libubsan0:amd64 (4.9.2-10, automatic), cpp-4.8:amd64 (4.8.4-1, automatic), cpp-4. 9:amd64 (4.9.2-10, automatic), libstdc++-4.9-dev:amd64 (4.9.2-10, automatic), libgomp1:amd64 (4.9.2-10, automatic), dkms:amd64 (2.2.0.3-2, automatic), libalgorithm-diff-xs-perl:amd64 (0.04-3+b1, automatic), libtsan0:amd64 (4.9.2-10, automatic), dpkg-dev:amd64 (1.17.25, automatic), libcilkrts5:amd64 (4.9.2-10, automatic), libalgorithm-merge-perl:amd64 (0.08-2, automatic), libc-dev-bin:amd64 (2.19-18, automatic), zfsutils:amd64 (0.6.4-1.2-1, automatic), linux-headers-3.16.0-4-amd64:amd64 (3.16.7-ckt11-1, automatic), g++:amd64 (4.9.2-2, automatic), spl:amd64 (0.6.4-1b, automatic), libatomic1:amd64 (4.9.2-10, automatic), libalgorithm-diff-perl:amd64 (1.19.02-3, automatic), libmpfr4:amd64 (3.1.2-2, automatic), g++-4.9:amd64 (4.9.2-10, automatic), debian-zfs:amd64 (7~jessie), binutils:amd64 (2.25-5, automatic), libnvpair1:amd64 (0.6.4-1.2-1, automatic), gcc:amd64 (4.9.2-2, automatic), libuutil1:amd64 (0.6.4-1.2-1, automatic), libgcc-4.8-dev:amd64 (4.8.4-1, automatic), libdpkg-perl:amd64 (1.17.25, automatic), cpp:amd64 (4.9.2-2, automatic), libfakeroot:amd64 (1.20.2-1, automatic), gcc-4.8:amd64 (4.8.4-1, automatic), gcc-4.9:amd64 (4.9.2-10, automatic), libcloog-isl4:amd64 (0.18.2-1+b2, automatic), libzpool2:amd64 (0.6.4-1.2-1, automatic), spl-dkms:amd64 (0.6.4-1b, automatic), linux-compiler-gcc-4.8-x86:amd64 (3.16.7-ckt11-1, automatic), manpages-dev:amd64 (3.74-1, automatic), build-essential:amd64 (11.7, automatic), zfs-dkms:amd64 (0.6.4-1.2-1, automatic), libgcc-4.9-dev:amd64 (4.9.2-10, automatic), libzfs2:amd64 (0.6.4-1.2-1, automatic), linux-headers-amd64:amd64 (3.16+63, automatic), linux-libc-dev:amd64 (3.16.7-ckt11-1, automatic), liblsan0:amd64 (4.9.2-10, automatic), linux-headers-3.16.0-4-common:amd64 (3.16.7-ckt11-1, automatic), libitm1:amd64 (4.9.2-10, automatic), libc6-dev:amd64 (2.19-18, automatic),` var substitution = "" fmt.Println(re.ReplaceAllString(str, substitution)) }

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/