Number Matching
The Number Matching Node
Category - Branching on Data
The Number Matching node compares a value in a source user buffer against a list of matching rule patterns.
The Buffer selection refers to which of the system buffers to compare against the match rule patterns. These buffers are configured within N2FE.
If the source buffer value matches the node dialog pattern the Number Found
branch will be followed.
If the source buffer value does not match the node dialog pattern the Number not Found
branch will be followed.
If the source buffer is otherwise undefined the Number is Undefined
branch will be followed.
Configuration
To configure the node:
- Select the buffer that will used as the source for comparison.
- Define one or more match rule patterns that will be used as the basis for matching against the source buffer value. See Match Rule Patterns for more information.
Match Rule Patterns
Each distinct line in the matching rules definition defines a distinct patterm match that will be performed against the configuration source buffer.
Each matching rule follows the NCC defined rules for search patterns.
Each matching rule is defined using a regular expression syntax. Some characters have special meaning when used in a regular expression; other characters stand for themselves.
Special characters
Here are the definitions of special characters that may be used in matching rules.
Special Character | Definition |
---|---|
c | Under ACS, phone number matching is customised for patterns of telephone numbers. The “number” character set is represented by digits zero through nine, asterisk, pound sign (hash mark), and the letters A through F. |
? | Any single character in the pattern. |
(r) | The regular expression r. For example, (r)x(y)z is the combination of regular expressions rxyzy. This is typically used to group number sequences as distinct units. |
r% | Zero or more successive occurrences of the regular expression r. The longest left-most match is chosen. |
rx | The occurrence of regular expression r, followed by the occurrence of regular expression x. |
r<m:n> | Any number of m through n successive occurrences of the regular expression r. The regular expression r |
[s] | Any character in the set s, where s is a sequence of characters and/or a range of characters, for example [0-9]. When used in square brackets, the dash denotes a range e.g. [c-c]. Note: The dash has no special meaning if it occurs immediately after the open bracket, or before the closing bracket: e.g. ([-c] or [c-]). |
[^s] | Any character not in the set s, where s is defined as in the previous entry. The circumflex has the meaning “complement of”, where it immediately follows the open bracket e.g. [^s]. A circumflex is not part of a telephone number, so a match will never be found for a pattern where the circumflex does not immediately follow the open bracket. |
Example Matching Rules
Search Pattern | Definition |
---|---|
123 | Match digit sequence ‘123’ exactly. |
123% | Match digit sequence ‘12’ followed by none or more ‘3’ digits {matches 12, 123, 1233, 12333} |
123<1:> | Match digit sequence ‘12’ followed by one or more ‘3’ digits {matches 123, 1233, 12333, ..} |
(123)% | Match none or more entire sequences of ‘123’ {matches nothing, 123, 123123, 123123123, …} |
(123)<1:2> | Match on at least one and no more than two sequences ‘123’ {matches ONLY 123 and 123123} |
123?<6:7> | Match starting digit sequence ‘123’ followed by at least 6 or 7 digits. |
123?<6:> | Match on at least 6 of any digit, no upper limit of digits |
12[34]?<6:> | Match on a number that starts with 12, is directly followed by a single digit 3 or 4, and followed by at least 6 occurrences of any digit. |
123?% | Match on a number where 123 is followed by anything or nothing. |
??123??? | Match on any 8-digit number where the 3rd to 5th digits are 123. |
?%123 | Match on any number ending in 123, including 123. |