There's one thing that bugs me in the page on modifier reform, and that's the syntax for specifying when to match.

and I quote:

A modifier that starts with a number causes the pattern to match that many times. It may only be used outside the regex. It may not be bundled, because ordinals are distinguished from cardinals. That is, how it treats those multiple matches depends on the next character. If you say

s:3x /foo/bar/

then it changes the first 3 instances. But if you say

s:3rd /foo/bar/

it changes only the 3rd instance. You can say

s:1st /foo/bar/

I love the concept, but I'm not too keen on the use of 1st, 2nd, 3rd, 4th... I think it's just a bit too clever for its own good. Wearing my programmer's hat, I would rather see a more generic method. Here, 1, 2 and 3 are exceptions. It's not until 4 that the pattern repeats. Wearing my linguist's hat, at least for the only other language I feel qualified to speak for, French, the pattern is simpler: 1er, 2eme, 3eme... (accents and gender notwithstanding). So by some unit of measure, the chosen syntax is more difficult than it could be.

Knowing the shorthand for cardinals is not one of the simpler things foreign students learn about in English, thus non-English speakers are at more of a disadvantage than for other keywords such as die, split, rename... at least you can find those in a dictionary.

A more linguistically neutral approach would be to use n: 1n, 2n, 3n. It looks more mathematical and ties in with "to the nth degree" thereby retaining some notion of cardinality.

Ok, I admit this is a minor nit, but I did find it quite jarring when I read the Apocalypse.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

In reply to Re: Apocalypse 5 and regexes (modifier reform) by grinder
in thread Apocalypse 5 and regexes by c-era

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.