Convert asterisk extensions to single numbers

hi,

i’m converting extensions.conf to DB routing. can you help me with regexp or something which converts dialplan to single numbers like _3X0 to 310,320,330,340,… ?

i found only pypi.python.org/pypi/asterisk_dialplan/0.1.2 but i need the opposite direction

thanks
Marek

Depends what You want to achieve …

A Single expression would be

s/X/[0-9]/g s/Z/[1-9]/g s/N/[2-9]/g

But this is standard and doen’t lead You to “single” extensions. If You want to have those You’ll need to iterate over the dialplan patterns to duplicate them. This could be tricky if You have several Special chars in a single extension in extensions.conf.

expecting list of single numbers

222333444
222333445
222333446