JavaStar

JavaStar is an online regular expression tester that uses RegExPlus to check for matches. It supports the majority of syntax available in Perl/PCRE and .NET.


Enter a regular expression to test, and the input to test it against.

After pressing the "find matches" button, the matches will be shown, along with any capturing groups. If a capture group is a named group, the name of the group will be shown as well.

If there are no matches, whether the input is a partial match will be shown.

Flags
                           

               

Input






    

Results
Loading JavaStar...

Summary of regular-expression constructs

Roll over a specific syntax for more details (via a ToolTip).

Characters
x \\ \t \n \r \f \a \e \cx
\0n \0nn \0mnn
\xhh \x{hhh..} \uhhhh
Character classes
[abc] [^abc] [a-zA-Z] [a-d[m-p]]
[a-z&&[def]] [a-z&&[^bc]] [a-z&&[^m-p]]
Predefined character classes
. \d \D \s \S \w \W
POSIX character classes (US-ASCII only)
\p{Lower} \p{Upper} \p{ASCII}
\p{Alpha} \p{Digit} \p{Alnum}
\p{Punct} \p{Graph} \p{Print}
\p{Blank} \p{Cntrl} \p{XDigit} \p{Space}

[:class:] syntax for POSIX classes is also supported.

java.lang.Character classes (simple java character type)
\p{javaLowerCase} \p{javaUpperCase}
\p{javaWhitespace} \p{javaMirrored}
Classes for Unicode blocks and categories
\p{InGreek} \p{Lu} \p{Sc}
\P{InGreek} [\p{L}&&[^\p{Lu}]]
Boundary matchers
^ $ \b \B \A \G \Z \z
Greedy quantifiers
X? X* X+ X{n} X{n,} X{n,m}
Reluctant quantifiers
X?? X*? X+? X{n}? X{n,}? X{n,m}?
Possessive quantifiers
X?+ X*+ X++ X{n}+ X{n,}+ X{n,m}+
Logical operators
XY X|Y
Capturing
(X) (?<name>X) (?'name'X) (?P<name>X)
Back references
\n \gn \g{n}
\g-n \g{-n}

\k<name> \k'name' \g{name}
\k{name} (?P=name)
Quotation
\ \Q \E
Special constructs (non-capturing)
(?:X) (?idmsuxJn-idmsuxJn:X)
(?>X) (?idmsuxJn-idmsuxJn)  (?|X)
Assertions (non-capturing)
(?=X) (?!X) (?<=X) (?<!X)
Comment (non-capturing)
(?x:#comment\n) (?xd:#comment\n) (?#comment)
Conditional patterns (non-capturing)

(?(condition)yes-pattern)
(?(condition)yes-pattern|no-pattern)

(?(n)...) (?(-n)...)
(?(<name>)...) (?('name')...) (?(name)...)
(?(assert)...)
Numeric ranges (non-capturing)
(?Z[start..end]) (?Z16[start..end])
(?NZ[start..end]) (?NZ16[start..end])

A special thanks

The inspiration for this page's layout was taken from these excellent regular expression testers:

I also want to thank Ajaxload - Ajax loading gif generator, which I used to generate the loading gif.