Displaying 1 result from an estimated 1 matches for "andmorestuff".
2013 Mar 27
1
Pattern matching repeating digits
...its? (Something similar to regular expressions' {})
Here's an example: let's say I have a string of things that need to be done for both extensions 233 and 255. I can either...
A) Repeat the exact same code for both extensions, like so:
exten => 233,1,DoStuff()
exten => 233,n,AndMoreStuff()
exten => 233,n,Dial(something)
exten => 255,1,DoStuff()
exten => 255,n,AndMoreStuff()
exten => 255,n,Dial(something)
...which is stupid, or...
B) I can attempt code reuse for similar cases (a Good Thing[tm]), and make as specific of a match as possible, like so:
exten => _2[35]...