Regex patterns

In various modules of a system you can use string replacement by regular expressions.
The examples of such modules are:

This functionality is used to replace the original string by certain rule.
Most often this is used to manipulate with inbound and outbound numbers, for example:

Rule formats.

Replacement rules can be defined using various syntaxes:

How number replacement is done.

Smartswitch takes original sring and begins iteration over configured rules according to rule priorities.
Rules with less priority value are handled first.
In web-interface rules by default are sorted according to priority.
Therefore, iterating replacement rules will be done from top to bottom.

For each rule system tries to find a match of original string to a regular expression, configured inside rule.
To find a match, specified format is used and a value of regular expression.

After match has been found, a replacement is done according to configured rule application options and a value inside replace field.
After replacement has been done, the original string is replaced with new one.
In case if option continue is not checked - search and replace stops.
In case if set - system moves to a next rule from the list according to priorities.

In case if match according to regular expression hasn't been found for current rule - system moves to a next rule from the list according to priorities.

Rule application options for replace patterns.

Русский перевод