On Wed, Dec 24, 2008 at 2:35 AM, Marc Weustink <m...@dommelstein.net> wrote:
> Mattias Gaertner wrote: > >> On Wed, 24 Dec 2008 01:41:16 +0200 >> ik <ido...@gmail.com> wrote: >> >> 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 ? >>>> >>> >> see also >> http://wiki.lazarus.freepascal.org/IDE_regular_expressions >> > > I know what regular expressions are, I know that when you are writing them, > you understand what you wanted to do, but 5 mins later you don't know > anymore what it meant, let alone how to debug. Funny, I'm not the original writer of the regex code, but I understood it. It's just another language for text patterns, that's all. A more complicated regex is harder to understand with that one I can agree, but like with Pascal, if you learn the language (and not only the syntax), you can understand most good written patterns. Ido > > > (no it wasn't a serious question) > > 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