Hi Rolf,
Most regexes I write only have a few modifiers, so it's hard to get confused no matter what order they are in, and in those cases I don't see order as a problem. Although I don't have a strong opinion on this, if I did have to settle on a standard, I might consider the order that Perl uses when regexes are stringified, e.g.
$ perl -wMstrict -le 'print qr/abc/msixpoun' (?upmsixn:abc)
Although unfortunately, it seems this order doesn't match with the documentation, qr/STRING/msixpodualn, which is another possible ordering...
Update: Also, I often place those modifiers that change the behavior of the regex, like /gc, first, so they're immediately obvious.
Regards,
-- Hauke D
In reply to Re: Best Practice: Order of regex modifiers?
by haukex
in thread Best Practice: Order of regex modifiers?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |