J uses the gnu.regexp package.
^matches the beginning of a line
$matches the end of a line
.matches any single character
\dmatches any decimal digit
\Dmatches any non-digit
\nmatches a newline character
\rmatches a return character
\smatches any whitespace character
\Smatches any non-whitespace character
\tmatches a tab character
\wmatches any word (alphanumeric) character
\Wmatches any non-word (alphanumeric) character
Otherwise,
\cmatches the character c.
[abc]matches any character in the set a, b or c
[^abc]matches any character not in the set a, b or c
[a-z]matches any character in the range a to z (inclusive)
A leading or trailing dash is interpreted literally.
(abc)matches whatever the expression abc would match, and saves it as a subexpression
\nwhere 1 <= n <= 9, matches the same thing the nth subexpression matched
Parentheses can also be used for grouping.
Parentheses used for grouping or to record matched subexpressions should not be escaped.
Backreferences may also be used in replacement strings; see replace.
a|bmatches whatever the expression a would match, or whatever the expression b would match.
?matches zero or one occurrence of the preceding expression or the null string
*matches zero or more occurrences of the preceding expression
+matches one or more occurrences of the preceding expression
{m}matches exactly m occurrences of the preceding expression
{m,n}matches between m and n occurrences of the preceding expression (inclusive)
{m,}matches m or more occurrences of the preceding expression
The repeating operators operate on the preceding atomic expression.
If a repeating operator is immediately followed by a ?, the repeating operator will stop at the smallest number of repetitions that can complete the rest of the match.