Difference between revisions of "M4 Regexp Examples"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
Regexp is used to allow/deny CallerID/Destinations for [[M2 Origination Points | Origination Points]], [[M2 Termination Points | Termination Points]] and [[M2 Dial Peers | Dial Peers]].
Regexp is used to allow/deny CallerID/Destinations for [[M2 Origination Points | Origination Points]], [[M2 Termination Points | Termination Points]] and [[M2 Dial Peers | Dial Peers]].
Basic Regexp operators and building blocks are explained [https://en.wikipedia.org/wiki/Regular_expression#POSIX_basic_and_extended here].


{| border="1" cellpadding="2" cellspacing="0"  
{| border="1" cellpadding="2" cellspacing="0"  
Line 24: Line 26:
| ^380(67|97|68|98)[0-9]{5,9}$|^998[0-9]{5,9}$ || only digits starting with 380(67,97,68,98) or 998, but number of digits after each prefix should be between 5 and 9. So, for example, 3809712345 will match, but 380971234 or 380971234567890 will NOT match.
| ^380(67|97|68|98)[0-9]{5,9}$|^998[0-9]{5,9}$ || only digits starting with 380(67,97,68,98) or 998, but number of digits after each prefix should be between 5 and 9. So, for example, 3809712345 will match, but 380971234 or 380971234567890 will NOT match.
|-
|-
| ^18762[138][0-9]+$|| only digits starting with 1867621, 1867623, 1867628
| ^370[138][0-9]+$|| only digits starting with 3701, 3703, 3708
|}
|}



Revision as of 18:05, 19 December 2019

Regexp is used to allow/deny CallerID/Destinations for Origination Points, Termination Points and Dial Peers.

Basic Regexp operators and building blocks are explained here.

Regexp Explanation
.* everything
^[0-9]+$ only digits
^[0-9]{9,}$ only digits, number more than 8 digits (9, 10, 11...)
^[0-9]{0,9}$ only digits, number less than 9 digits (1, 2, 3, 4, 5, 6, 7, 8)
^\+?[0-9]+$ optional + sign and only digits
^370[0-9]+$ only digits starting with 370
^370.*$ anything starting with 370
^(37[0-1]|44)[0-9]*$ only digits starting with 370 or 371 or 44
^380(67|97|68|98)[0-9]*$|^998[0-9]+$ only digits starting with 380(67,97,68,98) or 998(0-9), where 380(67,97,68,98) = 38067,38097,38068,38098 and 998(0-9) = 9980,...,9988,9989.
^380(67|97|68|98)[0-9]{5,9}$|^998[0-9]{5,9}$ only digits starting with 380(67,97,68,98) or 998, but number of digits after each prefix should be between 5 and 9. So, for example, 3809712345 will match, but 380971234 or 380971234567890 will NOT match.
^370[138][0-9]+$ only digits starting with 3701, 3703, 3708




See also