in reply to Re: Best Practice: Order of regex modifiers?
in thread Best Practice: Order of regex modifiers?

> Alphabetical. Surely if you are trying to eye-parse some code and want to know if a particular modifier has been applied, this is the clearest and fastest approach to use.

I disagree.

First one should separate modifiers which are s/// only from standard m// modifiers (the latter (most?) can also be pre-compiled into the regex using qr// )

Than ordering by (and/or)

make sense.

For instance /a /d /l /u are perlre#Character-set-modifiers ° but are mostly listed as /dual for obvious reasons, the word "dual" is far easy to remember. (I'd even argue that /i belongs to same category but which much higher frequency)

So I'd say divide and conquer, humans can grasp sets with 5 to 7 elements far more easily, so 5 categories with at most 5 elements should fit

(... because of connectivity problems the rest of the post got lost :/ ... TL; don't want to rewrite and posting by tethering thru mobile)

so my bet at the moment is the following order by categories, respecting frequency and memorization

Categories

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

° not sure why the deep linking doesn't work (for me) seems like the anchor is missing.

² in 5.10 perlre only listed 7 modifiers and already did a categorization: "g and c: Unlike i, m, s and x, these two flags affect the way the regex is used"