TANDBERG Border Controller User Guide
Page 112 of 118
21.
Appendix C: Regular Expression Reference
Regular expressions can be used in conjunction with a number of Border Controller features such as
alias transformations, zone transformations, CPL policy and ENUM. The Border Controller uses POSIX
format regular expression syntax.
For an example of regex usage, see
Call screening based on alias
(section 15.5.4).
Following is a list of commonly used special characters in regular expression syntax:
Note:
For a detailed description of regular expression syntax see [9].
.
Matches any character.
*
Matches 0 or more repetitions of the previous match.
For example .* will match against a sequence of any character.
+
Matches 1 or more repetitions of the previous match.
\
Escapes a regular expression special character.
\d
Matches any decimal digit, i.e. 0-9.
[]
Matches a set of characters. Each character in the set can be specified individually, or a
range can be specified by giving the first character in the range followed by the - character
and then the last character in the range.
For example, [a-z] will match against any lower case alphabetical character; [a-zA-Z] will
match against any alphabetical character.
Note that you can not use special characters within the [] - they will be taken literally.
For example [0-9#*] will match against any single E.164 character - the E.164 character set
is made up of the digits
0
-
9
plus the hash key "
#
" and the asterisk key "
*
".
()
Groups a set of matching characters together. Groups can be referenced when using replace
strings to modify a string that matches a regular expression.
For example, a regular expression can be constructed to transform a URI containing a user's
full name to a URI based on their initials. The regular expression
(.).*_(.).*(@example.com)
would match against the user
and with a replace string of
\1\2\3
would transform it to
.
|
Matches against one expression or an alternate expression.
For example
.*@example.(net|com)
will match against any URI for the domain
example.com
or the domain
example.net
.