cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
719
Views
0
Helpful
6
Replies

CUBE translation-rule replace called range with specific number

Matt Smith
Level 1
Level 1

Hello,

 

I have a translation rule where I'm attempting to replace a called range with a specific number:

voice translation-rule 998

rule 1 /\(\+4922126103[1-399]\)/ /+49221261030/

 

This works as expected on a single digit in the range:

test voice translation-rule 998 +49221261031 
Matched with rule 1
Original number: +49221261031 Translated number: +49221261030
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
 
 

But if the number is more than one digit in the range, only the first digit is replaced:

test voice translation-rule 998 +492212610311
Matched with rule 1
Original number: +492212610311 Translated number: +492212610301
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
 
Any suggestions on how to get this to work?
 
Thanks,
Steve
1 Accepted Solution

Accepted Solutions

Use this instead:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/

 

Chris

View solution in original post

6 Replies 6

Chris Deren
Hall of Fame
Hall of Fame

What is the range as +4922126103[1-399] implies +49221261031 - +49221261033, +49221261039

the digits in bracket substitue one digit, so it is either 1 through 3, or 9 which you list twice.

Chris

Makes sense, but the docs don't say single digit, kind of confusing... "Indicates a range when not in the first/last position. Used with the'[' and ']'."

My intended range is 49 221 261 031 to 49 221 261 03399 (399 numbers) and rewrite them to 49 221 261 030

Maybe I'm using the wrong method, is there another way I could accomplish this?

Thanks,

Steve

Use this instead:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/

 

Chris

Was just playing with that as well. Only seems to match if there are 2 digits after the 1-3 range:

rule 1 /\(\+4922126103[1-3]..\)/ /+49221261030/
test voice translation-rule 998 +49221261031  
test voice translation-rule 998 +49221261032
test voice translation-rule 998 +492212610311
test voice translation-rule 998 +4922126103111
Matched with rule 1
Original number: +4922126103111 Translated number: +49221261030
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none

I dont follow, how many digits would you like to see after 1-3?  Your range was 199-399 hence [1-3].., where .. covers 00-99

Chris

Right you are.. got it, thanks.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: