A newer version of this documentation is available.

View Latest

XDCR Filtering Regular Expression

This is a list of JavaScript regular expressions (RegEx) you can use for XDCR filtering.

Regular expressions (RegEx) are a powerful way to match a sequence of simple characters. You can use regular expressions to create filters.

Regular expressions are case-sensitive: a lowercase 'a' is distinct from an uppercase 'A'. You can enclose a range of characters in square brackets to match against all of those characters.

Expression Description [tT]here Matches against 'There' and 'there'

[ ]

Might be used on a range of characters separated by a - character.

[0-9]

Matches any digit.

[A-Z]

Matches any uppercase alpha character.

[A-Za-z0-9]

Matches any alphanumeric character.

You can use ranges to specify a group of characters. You can also use the following shortcuts:

Expression Description . Matches against any character.

\d

Matches against a digit [0-9]. *

\D

Matches against a non-digit [^0-9]. *

\s

Matches against a whitespace character (such as a tab, space, or line feed character).*

\S

Matches against a non-whitespace character.*

\w

Matches against an alphanumeric character [a-zA-Z_0-9].*

\W

Matches against a non-alphanumeric character.*

\xhh

Matches against a control character (for the hexadecimal character hh).*

\uhhhh

Matches against a Unicode character (for the hexadecimal character hhhh).*

*Since the backslash character is used to denote a specific search expression, if you want to match against this character you must enter a double backslash (\\).

To match against occurrences of a character or expression, you can use the following.

Expression Description * Matches against zero or more occurrences of the previous character or expression.

+

Matches against one or more occurrences of the previous character or expression.

?

Matches zero or one occurrence of the previous character or expression.

(n)

Matches n occurrences of the previous character or expression.

(n,m)

Matches from n to m occurrences of the previous character or expression.

You can provide text to replace all or part of your search string. To do this, you need to group together matches by enclosing them in parentheses so that they can be referenced in the replacement. To reference a matched parameter, use $n where n is the parameter starting from 1.