If you want to use call patern in dialplan, it has to always start with character _ (underscore).
X matches any number from 0-9 scale
Z matches any number from 1-9 scale
N matches any number from 2-9 scale
[1237-9] matches any number or letter in the brackets, in this case these are the numbers (1,2,3,7,9)
. wildcard, matches one or more characters
example: this pattern _[2-8]XXXXXXXX matches all numbers of 9 characters length and starting with number from 2-9 scale
| is separating prefix from number (example: 9|NXXXXXX would match if someone dial "95551234" but to canals will pass only "5551234")
For more detailed informations about asterisk dialplan is possible to use Asterisk documentation.