Regex Tester

Regex Tester


For example: \A[a-z0-9-]+\z

U f i m s u x


Which Regex function to run


result = ""


A single character of: a, b, or c
Any single character except: a, b, or c
Any single character in the range a-z
Any single character in the range a-z or A-Z
Start of line
End of line
Start of string
End of string
Any single character
Any whitespace character
Any non-whitespace character
Any digit
Any non-digit
Any word character (letter, number, underscore)
Any non-word character
Any word boundary
Capture everything enclosed
a or b
Zero or one of a
Zero or more of a
One or more of a
Exactly 3 of a
3 or more of a
Between 3 and 6 of a
unicode (u)
enables Unicode specific patterns like \p and change modifiers like \w, \W, \s and friends to also match on Unicode. It expects valid Unicode strings to be given on match
caseless (i)
adds case insensitivity
dotall (s)
causes dot to match newlines and also set newline to anycrlf; the new line setting can be overridden by setting (*CR) or (*LF) or (*CRLF) or (*ANY) according to :re documentation
multiline (m)
causes ^ and $ to mark the beginning and end of each line; use \A and \z to match the end or beginning of the string
extended (x)
whitespace characters are ignored except when escaped and allow # to delimit comments
firstline (f)
forces the unanchored pattern to match before or at the first newline, though the matched text may continue over the newline
ungreedy (U)
inverts the "greediness" of the regexp (the previous r option is deprecated in favor of U)
US Phone Number
\(?\d{3}\)?-? *\d{3}-? *-?\d{4}
Unix Epoch Time (named captures)
Entire string is only numbers
HTML attribute (eg: class)
Simple Email Address
Only alpha-numeric, underscore, and dash characters