[fpc-pascal] My favourite missing feature
Marco van de Voort
marcov at stack.nl
Mon Dec 22 21:05:22 CET 2008
In our previous episode, Mark Morgan Lloyd said:
> What /I/ miss is Perl's pattern matching, and I miss it to the extent
> that in some of my own scripting stuff I've implemented it myself:
>
> IF cells[2, dateTime] = /(\d\d)\/(\d\d)\/((\d\d)?\d\d)\s.*/i THEN BEGIN
> cells[6, 1]:= /1/ + ordinalSuffix(/1/);
> cells[7, 1]:= monthName(/2/);
> IF /3/ > 999 THEN
> cells[8, 1]:= /3/
> ELSE
> cells[8, 1]:= '20' + /3/
> END;
>
> I knew nobody'd like it- I'll get my coat.
>
> Merry Christmas and a happy New Year, everybody :-)
Well, at least it starts with a laugh :)
More information about the fpc-pascal
mailing list