How to order regular expression alternatives to get longest match?
Use the right regex flavor! In some regex flavors, the alternation providing the longest match is the one that is used (“greedy alternation”). Note that most of these regex flavors are old (yet still used today), and thus lack some modern constructs such as back references. Perl6 is modern (and has many features), yet defaults … Read more