Crystal regex tester

Regular expression:
Options:
Test string:

Reference

[abc]a, b, or c
[^abc]any character except a, b, or c
[a-z]any character from range a-z
[a-z0-9]any character from range a-z or 0-9
.any character
(...)group capture
(a|b)a or b (with capture)
(?:a|b)a or b (without capture)
a?zero or one of a
a*zero or more of a
a+one or more of a
a{3}exactly 3 of a
a{3,}3 or more of a
a{3,6}between 3 and 6 of a
\swhitespace character
\Snon-whitespace character
\ddigit
\Dnon-digit
\wword character (letter, number, underscore)
\Wnon-word character
^beginning of line
$end of line
\Abeginning of string
\zend of string
\Zend of string (matches just before newline if string ends with a newline)
\bword boundary
\Bnon-word boundary
(?:...)non-capturing group
(?<foo>...)named capture
(?=abc)positive lookahead: ensures that the following characters match abc, but doesn't include those characters in the matched text
(?!abc)negative lookahead: ensures that the following characters do not match abc, but doesn't include those characters in the matched text
(?<=abc)positive lookbehind: ensures that the preceding characters match abc, but doesn't include those characters in the matched text
(?<!abc)negative lookbehind: ensures that the preceding characters do not match abc, but doesn't include those characters in the matched text
\1use the result of group capture 1
\k<foo>use the result of named group capture foo
(?1)indexed subroutine (repeat the pattern of group 1)
(?&foo)named subroutine (repeat the pattern of group named foo)
(?(DEFINE)...)predefined subroutines
(?#...)comment