08-06-2007 09:56 AM - edited 03-14-2019 10:57 PM
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
08-06-2007 10:05 AM
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.
08-06-2007 10:10 AM
Thanks, p.
-Shikamaru
08-06-2007 10:24 AM
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
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