regular expressions

Marielle Lange M.Lange at ed.ac.uk
Sun Jul 3 07:57:28 EDT 2005


>Nobody *likes* RegEx. But it is powerful, and we use it because there
>is no practical alternative. I wish there were.

Hi Dave,

I do like regEx very much. Simply because that's the optimal solution to the
problem they address. That's an extraordinarily clever solution, which let you
write in a single line, what could take you pages of programs to code. Thanks
to regular expressions, I wrote in less than 20 lines the equivalent of a
program that a colleague of mine had written in nearly 10 pages.

Of course, the learning curve is very very slow... of course it is very easy to
make errors and quite difficult to keep track of what you are effectively
doing.  My approach is to test my regEx in editors like BBedit (mac) or notetab
(pc) first, so that I can tune them in an environment where I can rapidly check
that the effects are as desired (and yes, this may take a few trial and
errors).

Believe me, once you come to master regEx (which requires extensive use, in
different contexts) them, you come to see them as a real blessing rather than a
curse. After a rocky start, you just fall deeply in love with them.

Marielle



More information about the use-livecode mailing list