lswitch, a command in ycl switch, is like switch, but each pattern is a list of patterns to match against the item in string at the corresponding position. All switch options are supported.
lswitch is implemented using a heavy dose of knit.