Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

How does this translation rule break down?

In this rule;

rule 1 /\(.*\)/ /3000/

I'm having trouble understanding the syntax for

\(.*\)

I've looked at the documentation which explains that "\" slices up the number (whatever that means). The parenthesis indicate which matched numbers to keep, but what does it mean when we're saying that we want to keep ".*\" ? How does the last character of "\" work, why does it need to be there?

-Shikamaru

3 REPLIES
Hall of Fame Super Gold

Re: How does this translation rule break down?

Hi,

slice means "cut the number in sets", the ones that are in parenthesis are saved, others are not. The ones saved can be recalled in the in replaced part, however your example does not do that. What your example does is to prepend 3000 to any number, an can be rewritten more concisely as:

rule 1 // /3000/

The backlashes are simply need to quote parenthesis.

New Member

Re: How does this translation rule break down?

Thanks, p.

-Shikamaru

New Member

Re: How does this translation rule break down?

No, actually, this doesn't work. When you try to use two forward slashes in succession, IOS kicks it back as having ammended the digits, not replaced.

-Shikamaru

224
Views
0
Helpful
3
Replies
CreatePlease to create content