It looks for a date pattern like the follow 10/10/08 and 10/10/2008 with space and then some other chars as well.
I think if it was with boundaries of begin and/or end (^ and $) it would work even better. The () indicates groups. each group is the string extracted from the pattern, and can be used (that's the /1/ and /2/ that he wrote). This entire thingy called regular expression or regex for short. Ido On Wed, Dec 24, 2008 at 1:17 AM, Marc Weustink <m...@dommelstein.net> wrote: > Mark Morgan Lloyd wrote: > >> There seem to be a number of people currently making outrageous >> suggestions about missing features or how FPC could best be repackaged and >> promoted, so since it's the season of good will I trust that folk will >> tolerate this one from me. >> >> There's been a recent thread in fpc-other on second languages, but it >> appeared to focus more on what was a useful part of a developer's skillset >> rather than what people miss from Pascal. >> >> 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 >> > > and now in plain english, what does it match ? > > Marc > > > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal