> 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)
- category
- seniority (new vs established)
- frequency²
- memorizing
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
- Syntax x
- Line m,s
- Matching n,p
- Character i,d,u,a,l
- Operation g,c,(r)
- Substitution-only r, e,ee, o
° 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"
| [reply] [d/l] [select] |