09-15-2009 01:38 AM
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?
09-15-2009 01:49 AM
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.
09-15-2009 06:07 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide