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? }
In reply to Re: Longest match finding.
by graff
in thread Longest match finding.
by rrboloor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |