in reply to Longest match finding.
There might be more elegant or compact ways to express that (e.g. using an array of regex patterns), but the basic requirement is to test the patterns in order of relative specificity.if ( /567./ ) { # port 2 } elsif ( /56../ ) { # port 1 } elsif ( /5.../ ) { # port x } else { # what do we do in this case? }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Longest match finding.
by Anonymous Monk on Dec 17, 2008 at 09:25 UTC | |
by Corion (Patriarch) on Dec 17, 2008 at 09:59 UTC |