Mastering Regular Expressions 2nd Ed.

Tom Harris TomH at optiscan.com
Tue Jul 23 21:24:36 EDT 2002


>Regular expressions work much better if you use them for lexical
>analysis rather than for parsing.

>  Neil

Massive regular expressions are certainly difficult to maintain, and I
sometimes wonder if they are the best solution to some problems. Your
comments above seem to bear on the correct usage of them. Could you expand a
bit? Lexical analysis is tokenisation, parsing is making sense of the
tokens, is that correct? Is the moral to leave logic to the programming
language, not try to use regexes to di it?

Tom Harris, Software Engineer
Optiscan Imaging, 15-17 Normanby Rd, Notting Hill, Melbourne, Vic 3168,
Australia
email tomh at optiscan.com     ph +61 3 9538 3333  fax +61 3 9562 7742

This email may contain confidential information. If you have received this
email in error, please delete it immediately,and inform us of the mistake by
return email. Any form of reproduction, or further dissemination of this
email is strictly prohibited. Also, please note that opinions expressed in
this email are those of the author, and are not necessarily those of
Optiscan Pty Ltd.




More information about the Python-list mailing list