XDCR Regular Expressions
XDCR Regular Expressions can be used to specify character-matches, and thereby determine which documents should be included in filtered XDCR replications.
XDCR Regular Expressions
The following JavaScript regular expressions (RegExes) can be used for XDCR Advanced Filtering.
Note that 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 |
---|---|
|
Matches against 'There' and 'there' |
|
Can be used on a range of characters separated by a |
|
Matches any digit. |
|
Matches any uppercase alpha character. |
|
Matches any alphanumeric character. |
|
Matches beginning of input.
If the multi-line flag is set to The ' It can also be used as a " |
Ranges can be used to specify a group of characters. The following shortcuts are also available:
Expression | Description |
---|---|
|
Matches against any character. |
|
Matches against a digit [0-9]. * |
|
Matches against a non-digit |
|
Matches against a whitespace character (such as a tab, space, or line-feed character).* |
|
Matches against a non-whitespace character.* |
|
Matches against an alphanumeric character |
|
Matches against a non-alphanumeric character.* |
|
Matches against a control character (for the hexadecimal character |
|
Matches against a Unicode character (for the hexadecimal character |
Note that since the backslash character is used to denote a specific search expression, a double backslash (\\
) must be entered when the backslash is the search target.
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. |
|
Matches |
|
Matches from |
|
Matches at least |
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
.