Your correction needs a small correction:) We need to do the sort by length after the quotemetaing:
my $reOps = qr[@{[ join '|', sort { length $b <=> length $a } map{ quo +temeta } keys %ops ]}];
In reply to Re^3: Parsing with perl - Regexes and beyond
by BrowserUk
in thread RFC: Parsing with perl - Regexes and beyond
by moritz
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |