cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
513
Views
0
Helpful
2
Replies

Need help with voice translation rule

francisv
Level 1
Level 1

I wanted to create a rule that would match any number and append "1" to the number. I have created a sample voice translation:

voice translation-rule 2250

rule 1 /^(.+)/ /1\1/

but when I test the rule:

test voice translation-rule 2250 9047580977

9047580977 Didn't match with any of rules

How come?

2 Replies 2

francisv
Level 1
Level 1

Solved it. I had to add the "\" character before the "(" and ")" characters to get a match.

voice translation-rule 2250

rule 1 /^\(.+\)/ /1\1/

test voice translation-rule 2250 9047580977

Matched with rule 1

Original number: 9047580977 Translated number: 19047580977

I'm happy with this result.

You said that you wanted to append, not prepend. This is done more simply as:

rule 1 // /1/

Because // matches an empty string "before" the number", and the rest is copied unchanged.