Basic Regular Expression Constructs

This page lists very basic regular expression constructs that you can use in multiple NuoDB tools. In particular, regular expressions are allowed in the REGEXP pattern matching function in NuoDB SQL. For examples of how these constructs are used, see NuoDB SQL.

Syntax Pattern Match

^

Start of the expression.

$

End of the expression.

.

Any single character in the expression. Includes whitespace, tab, newline.

[abc]

A single character, a, b or c.

[^abc]

A single character, but neither a, nor b, nor c.

a|b|c

Any of the patterns a, b or c.

a*

Zero or more instances of a.

a+

One or more instances of a.

a?

Either zero or one instance of a.

(abc)*

Zero or more instances of the sequence abc.

a {n}

n instances of a.

a{n,}

n or more instances of a.

a {m,n}

m through n instances of a. m must be less than or equal to n.

[a-dX]

Any character that is either a, b, c, d or X

[^a-dX]

Any character that is neither a, b, c, d nor X